修复chart在未开启mysql服务代理时无法使用配置的mysql端口问题 #3385
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
修复admin、config、portal三个服务在通过helm部署时,如果不开启mysql的代理服务,values.yaml中的mysql端口不会被使用,会使用代理服务的端口。
以apollo-server/configserver 为例:
如果Values.configdb.service.enabled=false时,表示不使用mysql的代理,
此时configmap中的定义是:
注意,服务地址使用的模板定义,但端口使用的Values.configdb.service.port,这意味着不开启mysql代理时,连接的是自定义的mysql服务地址+代理服务的端口(尽管此时并没有开启代理服务)。
三个服务均有该问题,如果配置的mysql端口不是默认的3306时就能发现该问题(服务连不上数据库)
解决方案
对数据库端口也进行模板定义,configmap中修改为:
apollo.configdb.servicePort的模板定义如下:
以上是对configserver的修改,对adminserver只需调整configmap即可;portal则进行了以上相同的修改~