spring-cloud / spring-cloud-kubernetes

Kubernetes integration with Spring Cloud Discovery Client, Configuration, etc...
Apache License 2.0
3.46k stars 1.03k forks source link

KubernetesDiscoveryClientAutoConfiguration issue #945

Closed kabennett closed 2 years ago

kabennett commented 2 years ago

After upgrading from Spring Cloud 2020.0.3 to 2020.0.5, we are encountering the following exception:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'kubernetesInformerDiscoveryClient' defined in class path resource [org/springframework/cloud/kubernetes/client/discovery/KubernetesDiscoveryClientAutoConfiguration$KubernetesInformerDiscoveryConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Timeout waiting for informers cache to be ready, is the kubernetes service up?

We are using Spring Boot 2.5.8, and after reverting back to Spring Cloud 2020.0.3, this exception goes away and our k8s microservices start successfully. We previously tried upgrading to 2020.0.4, but there was an issue running our microservices in Minikube that prevented us from upgrading.

ryanjbaxter commented 2 years ago

Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.

kabennett commented 2 years ago

Unfortunately, the organization I work for strictly prohibits sharing any code, so I am not able to provide you an example given the nature of the project we are working on.

ryanjbaxter commented 2 years ago

Not even if it's not the code from the project?

We just need a way to reproduce it.

kabennett commented 2 years ago

I will try to put something together that reproduces what we are encountering.

kabennett commented 2 years ago

Looking into our code a bit more, at this point, we really aren't leveraging the Discovery Client feature yet, and I'm not sure if we will. We do have @EnableDiscoveryClient specified at the moment, but we aren't leveraging this feature as we connect microservices to each other via their k8s service names. So, would you recommend that I disable this feature in our microservices for the time being at least?

ryanjbaxter commented 2 years ago

Sure you can disable it, but I would still be curious how to reproduce the problem.

spring-cloud-issues commented 2 years ago

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.