How to disable KubernetesClientAutoConfiguration

See original GitHub issue

Describe the bug I set the following properties in my application properties files:

spring:
  cloud:
    kubernetes:
      enabled: false
      config:
        enabled: false

But I still see org.springframework.cloud.kubernetes.client.KubernetesClientAutoConfiguration#apiClient getting called. Am I missing something?

Sample k8s-config.zip

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
wind57commented, Dec 29, 2020

oh! you have spring-cloud-kubernetes-config on the classpath. I missed that, that is where the confusion came from. Now it all makes sense, yes.

0reactions
akefiradcommented, Dec 29, 2020

OK, found it in the documentation:

To disable the integration with Kubernetes you can set spring.cloud.kubernetes.enabled to false. Please be aware that when spring-cloud-kubernetes-config is on the classpath, spring.cloud.kubernetes.enabled should be set in bootstrap.{properties|yml} (or the profile specific one) otherwise it should be in application.{properties|yml} (or the profile specific one). Also note that these properties: spring.cloud.kubernetes.config.enabled and spring.cloud.kubernetes.secrets.enabled only take effect when set in bootstrap.{properties|yml}

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can we add a property to disable the kubernetes auto ...
hi, dev, Can we add a property to disable the kubernetes auto configure like what eureka does?
Read more >
Disable Spring Cloud Kubernetes in local - Stack Overflow
As the documentation says, you can do that by adding: spring.cloud.kubernetes.enabled=false. that, in turn, could be an environment property ...
Read more >
Spring Cloud Kubernetes
Include a starter to get the dependencies and Spring Boot auto-configuration for a feature set. Starters that begin with spring-cloud-starter-kubernetes-fabric8 ...
Read more >
KubernetesCatalogWatchAutoCo...
Class KubernetesCatalogWatchAutoConfiguration. java.lang.Object. org.springframework.cloud.kubernetes.discovery.KubernetesCatalogWatchAutoConfiguration ...
Read more >
Chapter 11. Integrating Spring Boot with Kubernetes
You can enable Kubernetes integration by adding it as a Maven dependency to ... Please note that, by default, consuming Secrets via API...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found