2

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 !!

Vish
  • 53
  • 7
  • spring cloud kubernetes 1.x is not compatible with boot 2.6, spring cloud 2021.0 – spencergibb May 23 '22 at 20:04
  • @spencergibb Thanks for your comment. Yeah you are right with the versioning part. And I'm not sure if supporting versions are released or renamed or I'm missing something here to make it working again. Link : loadbalancer : https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-kubernetes-loadbalancer starter-all : https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-kubernetes-all I see the latest is 1.1.10-RELEASE Do you know by chance what all kubernetes dependencies will work with spring boot 2.6.X and spring cloud 2021.0.X – Vish May 24 '22 at 04:08
  • Use boot dependency plug-in to manage spring cloud versions – spencergibb May 24 '22 at 10:45
  • You can also use start.spring.io to generate a pom with compatible dependencies. – OlgaMaciaszek May 25 '22 at 10:48
  • @OlgaMaciaszek : kubernetes dependencies are not available to select. – Vish May 26 '22 at 17:30
  • @spencergibb : sure that a good point, but my issues is which kubernetes version or dependency to be used with spring boot 2.6.6 or later – Vish May 26 '22 at 17:31
  • @Vish that sounds like a different question. –  May 27 '22 at 15:09
  • https://github.com/spring-cloud/spring-cloud-release/wiki/Supported-Versions#supported-releases – spencergibb May 27 '22 at 20:03
  • Please trim your code to make it easier to find your problem. Follow these guidelines to create a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). – Community May 27 '22 at 23:41
  • @spencergibb thanks very much for the wiki link which gives more clarity on the compatibility matrix and samples along with it… Appreciating your time & response.. – Vish May 28 '22 at 04:06

1 Answers1

3

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>
Vish
  • 53
  • 7