Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: divide the yurthubServer into hubServer and proxyServert #237

Merged
merged 1 commit into from
Mar 18, 2021

Conversation

rambohe-ch
Copy link
Member

Ⅰ. Describe what this PR does

Initially, yurtHubServer that listen on 127.0.0.1:10261 handle all requests from clients on edge node, so request can not be proxied to kube-apiserver but instead handled by yurthub itself when path of request is conflict with local yurthub requests.

in order to solve the above conflict, we divide the yurtHubServer into hubServer and porxyServer, and they listen on different port.

  • proxyServer listens on 127.0.0.1:10261, keep the same port as before
  • hubServer listen on 127.0.0.1:10267, can handle requests like pprof, token update, healthz, metrics etc.

by the way, we add a parameter --profiling to enable/disable debug pprof yurthub, default is enable pprof.

Ⅱ. Does this pull request fix one issue?

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Copy link
Member

@Fei-Guo Fei-Guo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Fei-Guo Fei-Guo merged commit a4e3240 into openyurtio:master Mar 18, 2021
@yixingjia
Copy link
Member

yixingjia commented Mar 18, 2021

@rambohe-ch Any cons on use a special prefix-path for yurt-hub related request compare with use a separator port?

eg: /v1/yurthub/xxx

@rambohe-ch
Copy link
Member Author

@rambohe-ch Any cons on use a special prefix-path for yurt-hub related request compare with use a separator port?

eg: /v1/yurthub/xxx

@yixingjia At first, YurtHub has used path to distinguish requests, but had ran into problems.

  • There are some common path for kube-apiserver and YurtHub, like /debug/pprof, /metrics, so path is not enough to distinguish requests.
  • on the other hand, The use of different ports can be more clearly defined function for proxy and hub agent.

zyjhtangtang pushed a commit to zyjhtangtang/openyurt that referenced this pull request Mar 31, 2021
@rambohe-ch rambohe-ch deleted the refactor-yurthubserver branch May 27, 2021 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants