-
Notifications
You must be signed in to change notification settings - Fork 454
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
feat: custom listening port for gateway pod in helm #829
feat: custom listening port for gateway pod in helm #829
Conversation
@Uncle-Justice higress controller的代码是不是漏提交了,即环境变量控制转换的逻辑 |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #829 +/- ##
==========================================
+ Coverage 38.04% 38.07% +0.03%
==========================================
Files 61 61
Lines 10428 10434 +6
==========================================
+ Hits 3967 3973 +6
Misses 6161 6161
Partials 300 300
|
@@ -357,6 +359,26 @@ func (c *controller) ConvertGateway(convertOptions *common.ConvertOptions, wrapp | |||
return fmt.Errorf("invalid ingress rule %s:%s in cluster %s, either `defaultBackend` or `rules` must be specified", cfg.Namespace, cfg.Name, c.options.ClusterId) | |||
} | |||
|
|||
// If no ports setting in yaml env(port is parsed as 0), take 80&443 as default. | |||
gatewayHttpPort, err := strconv.ParseUint(os.Getenv("GATEWAY_HTTP_PORT"), 10, 32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
每次都取环境变量不太好,可能作为启动参数,实现更简洁一些:
Lines 110 to 115 in b652f3e
serveCmd.PersistentFlags().Float32Var(&serverArgs.RegistryOptions.KubeOptions.KubernetesAPIQPS, "kubernetesApiQPS", 80.0, | |
"Maximum QPS when communicating with the kubernetes API") | |
serveCmd.PersistentFlags().IntVar(&serverArgs.RegistryOptions.KubeOptions.KubernetesAPIBurst, "kubernetesApiBurst", 160, | |
"Maximum burst for throttle when communicating with the kubernetes API") | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ⅰ. Describe what this PR did
使用helm安装higress时,在
values.yaml
中自定义gateway pod配置中的监听端口。产生的变化:
Ⅱ. Does this pull request fix one issue?
fixes #734
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
修改values.yaml中监听的http端口后,可在集群内部直接通过对应端口访问到服务
![image](https://private-user-images.githubusercontent.com/40391338/306301313-77c5f59e-622a-457d-80dc-d274a61dada9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1ODE4OTYsIm5iZiI6MTcyNDU4MTU5NiwicGF0aCI6Ii80MDM5MTMzOC8zMDYzMDEzMTMtNzdjNWY1OWUtNjIyYS00NTdkLTgwZGMtZDI3NGE2MWRhZGE5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI1VDEwMjYzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQxNmViMjQwODdlZDIxN2U0MTI3YWM4ZmI2OGFhNmNlYTcxNTIzNzFiYWVlNGRjNzQ5ZDg5MThjNzk5ZmE5YWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.K74wy1WqhK6dcXp9ffaXJme2e7AXeTd8UL2-QjIxGno)
在hostNetwork模式下,可在集群内部观察到envoy监听的端口也发生了对应的变化
![image](https://private-user-images.githubusercontent.com/40391338/306301507-5b55306a-f919-4806-a9d0-d78299d4ec3c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1ODE4OTYsIm5iZiI6MTcyNDU4MTU5NiwicGF0aCI6Ii80MDM5MTMzOC8zMDYzMDE1MDctNWI1NTMwNmEtZjkxOS00ODA2LWE5ZDAtZDc4Mjk5ZDRlYzNjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI1VDEwMjYzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUyZjhlMGUxZWM1NGMyOTkyMzI0YjI5MTEwNTE2ODAyZGI3N2RlN2VlZjJhODU1MTZhZDk3MzEzMGVjMDdmYTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.JNhUtuCGKNQ0bpcv_l4pybDfjkNB7AGMOEQ1OD7AhnU)
Ⅴ. Special notes for reviews