Closed dpandipperuma closed 1 year ago
sorry for the late reply.
I am not exactly sure what you are trying to do here, but first of all the dependencies that you have are really old and un-supported anymore. For example: spring-cloud-starter-kubernetes-ribbon
is not part of our repo anymore.
Now the exception that you get:
spring.cloud.kubernetes.discovery-server-url must be specified and a valid URL
is thrown by the kubernetesReactiveDiscoveryClient
as seen in the logs. The exception is thrown here:
https://github.com/spring-cloud/spring-cloud-kubernetes/blob/main/spring-cloud-kubernetes-discovery/src/main/java/org/springframework/cloud/kubernetes/discovery/KubernetesReactiveDiscoveryClient.java#L36..#L38
But what is that property supposed to be? Well, in order to understand that, you need to understand what spring-cloud-kubernetes-discoveryserver
docker image is, you can read more about it here
In very simple terms, that is an image that will discover kubernetes services and expose those to some endpoint. You can then query those endpoints (via the spring-cloud-kubernetes-discovery
- which throws the Exceptino in your case) and get the information needed.
So the spring.cloud.kubernetes.discovery-server-url
property is how you can reach the pod that encapsulates spring-cloud-kubernetes-discoveryserver
docker image. Usually, this is via the service name.
We have an integration test that uses this property you could take a look at: https://github.com/spring-cloud/spring-cloud-kubernetes/blob/main/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-discoveryclient-it/src/test/java/org/springframework/cloud/kubernetes/discoveryclient/it/DiscoveryClientFilterNamespaceIT.java
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.
Hi, i'm a newbie and i'm developing a sample spring cloud gateway application and i'm trying to access my microservices via service name. Below i have added my dependencies.
Then my application yaml file looks like below.
I added the @EnableDiscoveryClient annotation like below in my main file.
But when i try to clean install, it gives below error.
I saw there is a configuration like this -> kubernetes.discovery.discovery-server-url: "". But what i cant understand is what should i put as the server-url here. Please note - I'm using minikube to locally deploy my applications.
What am i missing here ?