-
Notifications
You must be signed in to change notification settings - Fork 133
fix:fix server address error when running in k8s #286
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
Conversation
when goc server running in k8s client register uri while be transform to is proxy address in fact,there is no need to transform add address uri check,make sure address parm is a complete uri
|
/assign @CarlJi |
|
@golangaccount Thanks for your contribution. The reason of this transform is try to find the proper IP especially in the local multi-interfaces scenario. And yes it's not elegant for the kubernetes scenario. To enhance it, we have solved this drawback in the goc v2 version by using web-socket protocol and welcome to have a try. https://github.com/qiniu/goc/tree/v2 For your PR, i am thinking that it's better to provide a switch in |
|
cureent, i use goc v1.x in project,so i think has necessary to merge v1.x. yea,use this code,the nat network will not work well,i will add a parm in goc server to switch two conditions |
add server runing parm network direct, when direct,use user request parm uri, default compare request parm uri host with client ip. use direct mode,goc server can runing in k8s change default mode port dispose rule when port is empty,use 80 replace because http default port is 80 add some rule to valid uri parm and change some regist unit testing case
|
@CarlJi i edit the code,add a parm to control the network,if not set,it runing default |
|
Hi @golangaccount , if i understood your scenario correctly, switch off the ip revise during registering should meet your requirements。 so no need to change the logic of 'registry API', since it will affect the old behaviors。 |
|
@CarlJi use bool can solve my problem,but there also has some question. if goc server is running, some client already regist,now i want to regist a new client with no revise,so i must set the value, use bool canot make sure the value is user set. |
|
while, if we want to let user be able to control this ability during registering from client side, i actually expect a new PR since it will also need to be changed for the for your questions, i suggest to deploy multi goc servers. In my original design concepts, goc server should be lightweight and close to the services under tests。(PS: maybe it should be called |
change goc server parm name,use ip_revise instead
|
@CarlJi i change the parm,use ip_revise in goc server. i still retain request parm (iprevise) to change the server running style |
Codecov Report
@@ Coverage Diff @@
## master #286 +/- ##
==========================================
+ Coverage 70.86% 71.00% +0.14%
==========================================
Files 34 34
Lines 2011 2038 +27
==========================================
+ Hits 1425 1447 +22
- Misses 475 478 +3
- Partials 111 113 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Hi @golangaccount , i am curious do you just use |
|
@CarlJi i also use goc build/install, goc server --ip_revise=false can solve my k8s question(other code no need change).
|
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CarlJi, golangaccount The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
when goc server running in k8s
client register uri while be transform to is proxy address
in fact,there is no need to transform
add address uri check,make sure address parm is a complete uri