spring-bootspring-cloudspring-cloud-kubernetesspring-cloud-loadbalancer

Spring Cloud Kubernetes Loadbalancer issue with Spring Boot 2.6.6


I am using spring boot 2.6.6 and spring cloud 2021.0.2 version with spring cloud kubernetes loadbalancer and spring cloud kubernetes all.

But I am getting error Application failed to start below are the dependencies

<properties>
   <spring-cloud.version>2021.0.2</spring-cloud.version>
   <spring-boot.version>2.6.6</spring-boot.version>
</properties>

<dependency>
   <groupId>org.springframework.cloud</groupId>
   <artifactId>spring-cloud-starter-kubernetes-all</artifactId>
   <version>1.1.10.RELEASE</version>
</dependency>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>${spring-cloud.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>${spring-boot.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-kubernetes-dependencies</artifactId>
            <version>1.1.10</version>
        </dependency>
    </dependencies>
</dependencyManagement>

Error:

2022-05-24 01:05:51.399 ERROR 14884 --- [ main] o.s.boot.SpringApplication : Application run failed

java.lang.IllegalStateException: Error processing condition on org.springframework.cloud.loadbalancer.config.LoadBalancerCacheAutoConfiguration$DefaultLoadBalancerCacheManagerConfiguration.defaultLoadBalancerCacheManager at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:60) ~[spring-boot-autoconfigure-2.6.6.jar:2.6.6] at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108) ~[spring-context-5.3.18.jar:5.3.18] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:193) ~[spring-context-5.3.18.jar:5.3.18] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:153) ~[spring-context-5.3.18.jar:5.3.18]

Process finished with exit code 1

Please if someone can help to understand what is the going wrong here. Any help is much appreciated.

Thanks !!


Solution

  • Thanking all to share your views via comments. I have figured out the answer.

    I see below dependency seems to be working fine with latest spring boot 2.6.6 or 2.7.0

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-kubernetes-fabric8-all</artifactId>
        <version>2.1.2</version>
    </dependency>
    

    It seems this is similar to what below ones use to provide, such as config or load balancer etc. certainly the dependencies are renamed as you can see.

    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-kubernetes-all</artifactId>
      <version>1.1.10.RELEASE</version>
    </dependency>