Closed ooiweijie closed 5 years ago
@ryanjbaxter @spencergibb what would we need to do to support this?
I am actually unsure as to why this does not work today. The basic idea is that the config client should use the discovery client implementation on the classpath to look up the URL to the config server. I am not sure what would prevent that from working when using the Kubernetes discovery client implementation. First place to look would be the config client code that is enabled when spring.cloud.config.discovery.enabled
is enabled.
There some bootstrapping that has to happen for the discovery client to load properly.
I don't know much about the ConfigServer, but I'll look into this soon hopefully
@spencergibb Isn't the bootstrapping already here?
Indeed it is
@spencergibb @ryanjbaxter @geoand Upon re-examining my codes, I realised that I have an extra line of code that overrides the value of spring.cloud.config.discovery.enabled
to false
. Upon removing that line of code and supplying the service id of the config server, it worked!
I truly apologise for any confusions that my question may have caused.
Glad to hear it worked @ooiweijie 😊
Spring Cloud Config Client should be able to use Kubernetes as the Discovery Client. Right now, if the following properties are used, the SCCC (name =
config-server
) will always attempt to retrieve the config fromlocalhost:8888
:Only when the config server's uri is specified can the config be retrieved successfully:
background: https://stackoverflow.com/questions/54702501/does-spring-cloud-config-client-support-using-kubernetes-as-a-discovery-client