Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConfigReloadUtil does not use sources listed in env specific yml files #1843

Open
bajibalu opened this issue Jan 18, 2025 · 0 comments
Open

Comments

@bajibalu
Copy link

bajibalu commented Jan 18, 2025

Describe the bug
I am trying to use config map to override some configs in my spring app. When I keep all the configurations in application.yml file the context gets reloaded and the values in the kubernetes config-map replaces the default config values in application.yml.

bootstrap.yaml

spring:
  application:
    name: spring-cm
  cloud:
    kubernetes:
      config:
        enabled: true

application.yml

spring:
  main:
    cloud-platform: kubernetes
  application:
    name: spring-cm
  profiles:
    active: dev
  cloud:
    kubernetes:
      config:
        namespace: spring-apps
        name: app-config-overrides
      reload:
        enabled: true
        monitoring-config-maps: true
        strategy: refresh
        mode: polling
  config:
    import: "kubernetes:"

springapp:
  cm:
    direct-message: "YAML: Hello!!!"
    app-yaml-message: "YAML: Hello!!!"
    numberVar: 2
    numberVal: 2

The logs below confirm that the above configuration is correct.

2025-01-17 18:43:28 level=DEBUG  logger=org.springframework.cloud.kubernetes.client.config.KubernetesClientConfigMapsCache message=Loaded all config maps in namespace 'spring-apps'
2025-01-17 18:43:28 level=DEBUG  logger=org.springframework.cloud.kubernetes.commons.config.ConfigUtils message=Found source with name : 'app-config-overrides' in namespace: 'spring-apps'
2025-01-17 18:43:28 level=DEBUG  logger=org.springframework.cloud.kubernetes.commons.config.SourceDataEntriesProcessor message=The single property with name: [application.yaml] will be treated as a yaml file
2025-01-17 18:43:28 level=DEBUG  logger=org.springframework.beans.factory.config.YamlPropertiesFactoryBean message=Loading from YAML: Byte array resource [resource loaded from byte array]
2025-01-17 18:43:28 level=DEBUG  logger=org.springframework.beans.factory.config.YamlPropertiesFactoryBean message=Matched document with default matcher: {springapp.cm={appYamlMessage=ConfigMap: Hello v1!!!, directMessage=ConfigMap: Hello!!!}}
2025-01-17 18:43:28 level=DEBUG  logger=org.springframework.beans.factory.config.YamlPropertiesFactoryBean message=Loaded 1 document from YAML resource: Byte array resource [resource loaded from byte array]
2025-01-17 18:43:28 level=WARN   logger=org.springframework.cloud.kubernetes.commons.config.ConfigUtils message=sourceName : app-config-overrides-dev was requested, but not found in namespace : spring-apps
2025-01-17 18:43:28 level=DEBUG  logger=org.springframework.cloud.kubernetes.commons.config.ConfigMapPropertySourceLocator message=Adding config map property source configmap.app-config-overrides.spring-apps
2025-01-17 18:43:28 level=DEBUG  logger=org.springframework.cloud.kubernetes.commons.config.ConfigMapPropertySourceLocator message=paths property sources : []
2025-01-17 18:43:28 level=DEBUG  logger=org.springframework.cloud.kubernetes.commons.config.reload.ConfigReloadUtil message=environment from locateMapPropertySources : ApplicationServletEnvironment {activeProfiles=[dev], defaultProfiles=[default], propertySources=[MapPropertySource@1620993234 {name='server.ports', properties={local.server.port=8080}}, ConfigurationPropertySourcesPropertySource@1289744459 {name='configurationProperties', properties=org.springframework.boot.context.properties.source.SpringConfigurationPropertySources@1d9bf948}, StubPropertySource@122474156 {name='servletConfigInitParams', properties=java.lang.Object@d85d5f2}, ServletContextPropertySource@1055601057 {name='servletContextInitParams', properties=org.apache.catalina.core.ApplicationContextFacade@7c78ce8d}, PropertiesPropertySource@488658432 {name='systemProperties', properties={java.specification.version=21, sun.jnu.encoding=UTF-8, java.class.path=/Users/bbalu/work/workspace/my-apps/spring-configmap-example/target/classes:/Users/bbalu/work/repo/mvn/org/jetbrains/kotlin/kotlin-stdlib/1.9.25/kotlin-stdlib-1.9.25.jar:/Users/bbalu/work/repo/mvn/org/jetbrains/annotations/13.0/annotations-13.0.jar:/Users/bbalu/work/repo/mvn/org/jetbrains/kotlinx/kotlinx-coroutines-reactor/1.8.1/kotlinx-coroutines-reactor-1.8.1.jar:/Users/bbalu/work/repo/mvn/org/jetbrains/kotlinx/kotlinx-coroutines-core-jvm/1.8.1/kotlinx-coroutines-core-jvm-1.8.1.jar:/Users/bbalu/work/repo/mvn/io/projectreactor/reactor-core/3.7.1/reactor-core-3.7.1.jar:/Users/bbalu/work/repo/mvn/org/reactivestreams/reactive-streams/1.0.4/reactive-streams-1.0.4.jar:/Users/bbalu/work/repo/mvn/org/jetbrains/kotlinx/kotlinx-coroutines-reactive/1.8.1/kotlinx-coroutines-reactive-1.8.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot-starter-web/3.4.1/spring-boot-starter-web-3.4.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot-starter/3.4.1/spring-boot-starter-3.4.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot/3.4.1/spring-boot-3.4.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot-autoconfigure/3.4.1/spring-boot-autoconfigure-3.4.1.jar:/Users/bbalu/work/repo/mvn/jakarta/annotation/jakarta.annotation-api/2.1.1/jakarta.annotation-api-2.1.1.jar:/Users/bbalu/work/repo/mvn/org/yaml/snakeyaml/2.3/snakeyaml-2.3.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot-starter-json/3.4.1/spring-boot-starter-json-3.4.1.jar:/Users/bbalu/work/repo/mvn/com/fasterxml/jackson/core/jackson-databind/2.18.2/jackson-databind-2.18.2.jar:/Users/bbalu/work/repo/mvn/com/fasterxml/jackson/core/jackson-annotations/2.18.2/jackson-annotations-2.18.2.jar:/Users/bbalu/work/repo/mvn/com/fasterxml/jackson/core/jackson-core/2.18.2/jackson-core-2.18.2.jar:/Users/bbalu/work/repo/mvn/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.18.2/jackson-datatype-jdk8-2.18.2.jar:/Users/bbalu/work/repo/mvn/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.18.2/jackson-datatype-jsr310-2.18.2.jar:/Users/bbalu/work/repo/mvn/com/fasterxml/jackson/module/jackson-module-parameter-names/2.18.2/jackson-module-parameter-names-2.18.2.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot-starter-tomcat/3.4.1/spring-boot-starter-tomcat-3.4.1.jar:/Users/bbalu/work/repo/mvn/org/apache/tomcat/embed/tomcat-embed-core/10.1.34/tomcat-embed-core-10.1.34.jar:/Users/bbalu/work/repo/mvn/org/apache/tomcat/embed/tomcat-embed-el/10.1.34/tomcat-embed-el-10.1.34.jar:/Users/bbalu/work/repo/mvn/org/apache/tomcat/embed/tomcat-embed-websocket/10.1.34/tomcat-embed-websocket-10.1.34.jar:/Users/bbalu/work/repo/mvn/org/springframework/spring-web/6.2.1/spring-web-6.2.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/spring-beans/6.2.1/spring-beans-6.2.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/spring-webmvc/6.2.1/spring-webmvc-6.2.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/spring-aop/6.2.1/spring-aop-6.2.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/spring-context/6.2.1/spring-context-6.2.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/spring-expression/6.2.1/spring-expression-6.2.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot-starter-actuator/3.4.1/spring-boot-starter-actuator-3.4.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot-actuator-autoconfigure/3.4.1/spring-boot-actuator-autoconfigure-3.4.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot-actuator/3.4.1/spring-boot-actuator-3.4.1.jar:/Users/bbalu/work/repo/mvn/io/micrometer/micrometer-observation/1.14.2/micrometer-observation-1.14.2.jar:/Users/bbalu/work/repo/mvn/io/micrometer/micrometer-commons/1.14.2/micrometer-commons-1.14.2.jar:/Users/bbalu/work/repo/mvn/io/micrometer/micrometer-jakarta9/1.14.2/micrometer-jakarta9-1.14.2.jar:/Users/bbalu/work/repo/mvn/io/micrometer/micrometer-core/1.14.2/micrometer-core-1.14.2.jar:/Users/bbalu/work/repo/mvn/org/hdrhistogram/HdrHistogram/2.2.2/HdrHistogram-2.2.2.jar:/Users/bbalu/work/repo/mvn/org/latencyutils/LatencyUtils/2.0.3/LatencyUtils-2.0.3.jar:/Users/bbalu/work/repo/mvn/org/springframework/cloud/spring-cloud-starter-kubernetes-client/3.2.0/spring-cloud-starter-kubernetes-client-3.2.0.jar:/Users/bbalu/work/repo/mvn/org/springframework/cloud/spring-cloud-kubernetes-client-discovery/3.2.0/spring-cloud-kubernetes-client-discovery-3.2.0.jar:/Users/bbalu/work/repo/mvn/org/springframework/cloud/spring-cloud-kubernetes-client-autoconfig/3.2.0/spring-cloud-kubernetes-client-autoconfig-3.2.0.jar:/Users/bbalu/work/repo/mvn/org/springframework/cloud/spring-cloud-commons/4.2.0/spring-cloud-commons-4.2.0.jar:/Users/bbalu/work/repo/mvn/org/springframework/security/spring-security-crypto/6.4.2/spring-security-crypto-6.4.2.jar:/Users/bbalu/work/repo/mvn/org/springframework/cloud/spring-cloud-starter-kubernetes-client-config/3.2.0/spring-cloud-starter-kubernetes-client-config-3.2.0.jar:/Users/bbalu/work/repo/mvn/org/springframework/cloud/spring-cloud-kubernetes-client-config/3.2.0/spring-cloud-kubernetes-client-config-3.2.0.jar:/Users/bbalu/work/repo/mvn/org/springframework/cloud/spring-cloud-kubernetes-commons/3.2.0/spring-cloud-kubernetes-commons-3.2.0.jar:/Users/bbalu/work/repo/mvn/org/springframework/cloud/spring-cloud-context/4.2.0/spring-cloud-context-4.2.0.jar:/Users/bbalu/work/repo/mvn/io/kubernetes/client-java/19.0.1/client-java-19.0.1.jar:/Users/bbalu/work/repo/mvn/io/prometheus/simpleclient/0.16.0/simpleclient-0.16.0.jar:/Users/bbalu/work/repo/mvn/io/prometheus/simpleclient_tracer_otel/0.16.0/simpleclient_tracer_otel-0.16.0.jar:/Users/bbalu/work/repo/mvn/io/prometheus/simpleclient_tracer_common/0.16.0/simpleclient_tracer_common-0.16.0.jar:/Users/bbalu/work/repo/mvn/io/prometheus/simpleclient_tracer_otel_agent/0.16.0/simpleclient_tracer_otel_agent-0.16.0.jar:/Users/bbalu/work/repo/mvn/io/prometheus/simpleclient_httpserver/0.16.0/simpleclient_httpserver-0.16.0.jar:/Users/bbalu/work/repo/mvn/io/prometheus/simpleclient_common/0.16.0/simpleclient_common-0.16.0.jar:/Users/bbalu/work/repo/mvn/io/kubernetes/client-java-api/19.0.1/client-java-api-19.0.1.jar:/Users/bbalu/work/repo/mvn/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar:/Users/bbalu/work/repo/mvn/io/swagger/swagger-annotations/1.6.11/swagger-annotations-1.6.11.jar:/Users/bbalu/work/repo/mvn/com/squareup/okhttp3/okhttp/4.11.0/okhttp-4.11.0.jar:/Users/bbalu/work/repo/mvn/com/squareup/okio/okio/3.2.0/okio-3.2.0.jar:/Users/bbalu/work/repo/mvn/com/squareup/okio/okio-jvm/3.2.0/okio-jvm-3.2.0.jar:/Users/bbalu/work/repo/mvn/org/jetbrains/kotlin/kotlin-stdlib-common/1.9.25/kotlin-stdlib-common-1.9.25.jar:/Users/bbalu/work/repo/mvn/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.9.25/kotlin-stdlib-jdk8-1.9.25.jar:/Users/bbalu/work/repo/mvn/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.9.25/kotlin-stdlib-jdk7-1.9.25.jar:/Users/bbalu/work/repo/mvn/com/squareup/okhttp3/logging-interceptor/4.11.0/logging-interceptor-4.11.0.jar:/Users/bbalu/work/repo/mvn/com/google/code/gson/gson/2.11.0/gson-2.11.0.jar:/Users/bbalu/work/repo/mvn/io/gsonfire/gson-fire/1.8.5/gson-fire-1.8.5.jar:/Users/bbalu/work/repo/mvn/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/Users/bbalu/work/repo/mvn/io/kubernetes/client-java-proto/19.0.1/client-java-proto-19.0.1.jar:/Users/bbalu/work/repo/mvn/commons-codec/commons-codec/1.17.1/commons-codec-1.17.1.jar:/Users/bbalu/work/repo/mvn/org/apache/commons/commons-compress/1.26.1/commons-compress-1.26.1.jar:/Users/bbalu/work/repo/mvn/org/apache/commons/commons-lang3/3.17.0/commons-lang3-3.17.0.jar:/Users/bbalu/work/repo/mvn/commons-io/commons-io/2.14.0/commons-io-2.14.0.jar:/Users/bbalu/work/repo/mvn/org/bouncycastle/bcpkix-jdk18on/1.76/bcpkix-jdk18on-1.76.jar:/Users/bbalu/work/repo/mvn/org/bouncycastle/bcutil-jdk18on/1.76/bcutil-jdk18on-1.76.jar:/Users/bbalu/work/repo/mvn/com/google/protobuf/protobuf-java/3.24.3/protobuf-java-3.24.3.jar:/Users/bbalu/work/repo/mvn/org/apache/commons/commons-collections4/4.4/commons-collections4-4.4.jar:/Users/bbalu/work/repo/mvn/org/bitbucket/b_c/jose4j/0.9.3/jose4j-0.9.3.jar:/Users/bbalu/work/repo/mvn/io/kubernetes/client-java-extended/19.0.1/client-java-extended-19.0.1.jar:/Users/bbalu/work/repo/mvn/io/kubernetes/client-java-api-fluent/19.0.1/client-java-api-fluent-19.0.1.jar:/Users/bbalu/work/repo/mvn/com/github/vladimir-bukhtoyarov/bucket4j-core/7.6.0/bucket4j-core-7.6.0.jar:/Users/bbalu/work/repo/mvn/com/flipkart/zjsonpatch/zjsonpatch/0.4.14/zjsonpatch-0.4.14.jar:/Users/bbalu/work/repo/mvn/com/github/ben-manes/caffeine/caffeine/3.1.8/caffeine-3.1.8.jar:/Users/bbalu/work/repo/mvn/org/checkerframework/checker-qual/3.37.0/checker-qual-3.37.0.jar:/Users/bbalu/work/repo/mvn/com/google/errorprone/error_prone_annotations/2.21.1/error_prone_annotations-2.21.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/cloud/spring-cloud-starter/4.2.0/spring-cloud-starter-4.2.0.jar:/Users/bbalu/work/repo/mvn/org/bouncycastle/bcprov-jdk18on/1.78.1/bcprov-jdk18on-1.78.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot-starter-log4j2/3.4.1/spring-boot-starter-log4j2-3.4.1.jar:/Users/bbalu/work/repo/mvn/org/apache/logging/log4j/log4j-api/2.20.0/log4j-api-2.20.0.jar:/Users/bbalu/work/repo/mvn/org/apache/logging/log4j/log4j-core/2.20.0/log4j-core-2.20.0.jar:/Users/bbalu/work/repo/mvn/org/apache/logging/log4j/log4j-slf4j-impl/2.20.0/log4j-slf4j-impl-2.20.0.jar:/Users/bbalu/work/repo/mvn/org/apache/logging/log4j/log4j-slf4j2-impl/2.24.3/log4j-slf4j2-impl-2.24.3.jar:/Users/bbalu/work/repo/mvn/org/apache/logging/log4j/log4j-jul/2.24.3/log4j-jul-2.24.3.jar:/Users/bbalu/work/repo/mvn/org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar:/Users/bbalu/work/repo/mvn/org/slf4j/jul-to-slf4j/2.0.16/jul-to-slf4j-2.0.16.jar:/Users/bbalu/work/repo/mvn/jakarta/json/jakarta.json-api/2.1.3/jakarta.json-api-2.1.3.jar:/Users/bbalu/work/repo/mvn/org/springframework/spring-core/6.2.1/spring-core-6.2.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/spring-jcl/6.2.1/spring-jcl-6.2.1.jar, java.vm.vendor=Eclipse Adoptium, sun.arch.data.model=64, java.vendor.url=https://adoptium.net/, catalina.useNaming=false, user.timezone=America/Chicago, java.vm.specification.version=21, os.name=Mac OS X, APPLICATION_NAME=spring-cm, sun.java.launcher=SUN_STANDARD, user.country=US, sun.boot.library.path=/Users/bbalu/work/repo/gradle/jdks/eclipse_adoptium-21-aarch64-os_x.2/jdk-21.0.5+11/Contents/Home/lib, spring.application.admin.enabled=true, sun.java.command=my.test.spring.cm.ApplicationKt, com.sun.management.jmxremote=, http.nonProxyHosts=local|*.local|169.254/16|*.169.254/16, jdk.debug=release, spring.liveBeansView.mbeanDomain=, sun.cpu.endian=little, user.home=/Users/bbalu, user.language=en, sun.stderr.encoding=UTF-8, java.specification.vendor=Oracle Corporation, java.version.date=2024-10-15, java.home=/Users/bbalu/work/repo/gradle/jdks/eclipse_adoptium-21-aarch64-os_x.2/jdk-21.0.5+11/Contents/Home, spring.profiles.active=dev, spring.output.ansi.enabled=always, file.separator=/, java.vm.compressedOopsMode=Zero based, sun.stdout.encoding=UTF-8, line.separator=
, java.vm.specification.vendor=Oracle Corporation, java.specification.name=Java Platform API Specification, FILE_LOG_CHARSET=UTF-8, java.awt.headless=true, apple.awt.application.name=ApplicationKt, sun.management.compiler=HotSpot 64-Bit Tiered Compilers, ftp.nonProxyHosts=local|*.local|169.254/16|*.169.254/16, java.runtime.version=21.0.5+11-LTS, user.name=bbalu, spring.jmx.enabled=true, stdout.encoding=UTF-8, path.separator=:, management.endpoints.jmx.exposure.include=*, os.version=15.2, java.runtime.name=OpenJDK Runtime Environment, file.encoding=UTF-8, java.vm.name=OpenJDK 64-Bit Server VM, java.vendor.version=Temurin-21.0.5+11, java.vendor.url.bug=https://github.com/adoptium/adoptium-support/issues, java.io.tmpdir=/var/folders/7f/65xw8t514vn93l5sfs67vgch0000gp/T/, catalina.home=/private/var/folders/7f/65xw8t514vn93l5sfs67vgch0000gp/T/tomcat.8080.6022252183459245718, java.version=21.0.5, user.dir=/Users/bbalu/work/workspace/my-apps/spring-configmap-example, os.arch=aarch64, java.vm.specification.name=Java Virtual Machine Specification, PID=46233, CONSOLE_LOG_CHARSET=UTF-8, catalina.base=/private/var/folders/7f/65xw8t514vn93l5sfs67vgch0000gp/T/tomcat.8080.6022252183459245718, native.encoding=UTF-8, java.library.path=/Users/bbalu/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:., java.vm.info=mixed mode, emulated-client, sharing, stderr.encoding=UTF-8, java.vendor=Eclipse Adoptium, java.vm.version=21.0.5+11-LTS, java.rmi.server.randomIDs=true, sun.io.unicode.encoding=UnicodeBig, socksNonProxyHosts=local|*.local|169.254/16|*.169.254/16, java.class.version=65.0, LOGGED_APPLICATION_NAME=[spring-cm] }}, OriginAwareSystemEnvironmentPropertySource@1051277843 {name='systemEnvironment', properties={HOMEBREW_PREFIX=/opt/homebrew, GOPATH=/Users/bbalu/work/runtimes/go/1.16.1, MANPATH=/opt/homebrew/share/man::, COMMAND_MODE=unix2003, INFOPATH=/opt/homebrew/share/info:, SHELL=/bin/zsh, TMPDIR=/var/folders/7f/65xw8t514vn93l5sfs67vgch0000gp/T/, __CFBundleIdentifier=com.jetbrains.intellij, TOMCAT_HOME=/Users/bbalu/work/servers/tomcat-8.0.26-x64, HOME=/Users/bbalu, HOMEBREW_REPOSITORY=/opt/homebrew, GEMFIRE=/Users/bbalu/work/servers/gemfire_820_b17919_linux, TOOLS_HOME=/Users/bbalu/work/tools, PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/usr/local/sbin:/Users/bbalu/work/bin:/Users/bbalu/.local/bin:/Users/bbalu/work/runtimes/android/sdk/platform-tools:/Users/bbalu/work/runtimes/android/cmdline-tools/bin:/Users/bbalu/work/runtimes/go/1.16.1/bin:/Users/bbalu/work/db/neo4j/5.25.1/bin:/Users/bbalu/work/tools/kafka/2.4.0/bin:/Users/bbalu/work/tools/apache-axis2/1.7.5/bin:/Users/bbalu/work/db/apache-cassandra/3.11.14/bin:/Users/bbalu/work/tools/apache-cxf/3.1.12/bin:/Users/bbalu/work/tools/aws_key_gen/0.11.2:/Users/bbalu/work/tools/aws-cli/2.22.32/bin:/Users/bbalu/work/tools/aws-sm/bin:/Applications/Docker.app/Contents/Resources/bin/:/Users/bbalu/work/tools/egctl/1.35.0:/Users/bbalu/work/tools/elasticsearch/8.8.1/bin:/Users/bbalu/work/tools/gradle/7.6/bin:/Users/bbalu/work/tools/grpcui/1.3.1:/Users/bbalu/work/tools/helm/3.12.0/bin:/Users/bbalu/work/tools/kibana/7.17.7/bin:/Users/bbalu/work/tools/kubectl/v1.15.12:/Users/bbalu/work/tools/apache-maven/3.6.3/bin:/Users/bbalu/work/tools/memgraph/console/1.4.0:/Users/bbalu/work/tools/minikube/v1.34.0:/Users/bbalu/work/tools/pnpm/9.4.0/bin:/Users/bbalu/work/tools/prism-x64:/Users/bbalu/work/tools/protobuf/3.11.4:/Users/bbalu/work/tools/redis/6.0.6/bin:/Users/bbalu/work/tools/terraform/0.14.7:/Users/bbalu/work/tools/vcert/v5.1.1:/Users/bbalu/work/tools/visualvm/2.1.10/bin:/Users/bbalu/work/tools/yarn/1.16.0/bin:/Users/bbalu/work/tools/zipkin/2.23.2/bin:/Users/bbalu/work/servers/servicemix-7.0.1/bin:/Users/bbalu/work/servers/gemfire_820_b17919_linux/bin:/Users/bbalu/work/workspace/tls/lpas/lpas-grid/src:/Users/bbalu/.local/bin, LOGNAME=bbalu, DB_HOME=/Users/bbalu/work/db, SERVICEMIX_HOME=/Users/bbalu/work/servers/servicemix-7.0.1, __CF_USER_TEXT_ENCODING=0x1F6:0x0:0x0, XPC_FLAGS=0x0, spring.cloud.kubernetes.client.namespace=spring-apps, SOURCE_ROOT=/Users/bbalu/work/workspace/tls/lpas/lpas-grid, P4CONFIG=/Users/bbalu/work/bin/p4.ini, LC_CTYPE=en_US.UTF-8, GRADLE_USER_HOME=/Users/bbalu/work/repo/gradle, CATALINA_HOME=/Users/bbalu/work/servers/tomcat-8.0.26-x64, GEMFIRE_BASE=/Users/bbalu/work/servers/gemfire_820_b17919_linux/deploy, WORK_BIN=/Users/bbalu/work/bin, SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.rcHYvfWEr0/Listeners, OLDPWD=/, WORK_HOME=/Users/bbalu/work, XPC_SERVICE_NAME=application.com.jetbrains.intellij.759892.759898, spring_debug=-Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005", USER=bbalu, HOMEBREW_CELLAR=/opt/homebrew/Cellar, GRADLE_HOME=/Users/bbalu/work/tools/gradle/7.6, PWD=/Users/bbalu/work/workspace/my-apps/spring-configmap-example}}, RandomValuePropertySource@195022150 {name='random', properties=java.util.Random@113ff4e9}, CachedRandomPropertySource@70164941 {name='cachedrandom', properties=RandomValuePropertySource@195022150 {name='random', properties=java.util.Random@113ff4e9}}, CompositePropertySource {name='composite-configmap', propertySources=[KubernetesClientConfigMapPropertySource@1879071388 {name='configmap.app-config-overrides.spring-apps', properties={springapp.cm.directMessage=ConfigMap: Hello!!!, springapp.cm.appYamlMessage=ConfigMap: Hello!!!}}]}, CompositePropertySource {name='composite-secrets', propertySources=[]}, OriginTrackedMapPropertySource@83909671 {name='Config resource 'class path resource [application.yml]' via location 'optional:classpath:/'', properties={spring.main.cloud-platform=kubernetes, spring.application.name=spring-cm, spring.profiles.active=dev, spring.cloud.kubernetes.config.namespace=spring-apps, spring.cloud.kubernetes.config.name=app-config-overrides, spring.cloud.kubernetes.reload.enabled=true, spring.cloud.kubernetes.reload.monitoring-config-maps=true, spring.cloud.kubernetes.reload.strategy=refresh, spring.cloud.kubernetes.reload.mode=polling, spring.config.import=kubernetes:, springapp.cm.direct-message=YAML: Hello!!!, springapp.cm.app-yaml-message=YAML: Hello!!!, springapp.cm.numberVar=2, springapp.cm.numberVal=2, management.endpoints.web.exposure.include=info,health,metrics,loggers,refresh,beans,heapdump}}, MapPropertySource@1802922194 {name='springCloudClientHostInfo', properties={spring.cloud.client.hostname=172.17.40.151, spring.cloud.client.ip-address=172.17.40.151}}, ApplicationInfoPropertySource@438799544 {name='applicationInfo', properties={spring.application.pid=46233}}, @1877436809 {name='Management Server', properties=java.lang.Object@370fbc5f}]}
2025-01-17 18:43:28 level=DEBUG  logger=org.springframework.cloud.kubernetes.commons.config.reload.ConfigReloadUtil message=sources from locateMapPropertySources : [KubernetesClientConfigMapPropertySource@1074030799 {name='configmap.app-config-overrides.spring-apps', properties={springapp.cm.directMessage=ConfigMap: Hello!!!, springapp.cm.appYamlMessage=ConfigMap: Hello v1!!!}}]
2025-01-17 18:43:28 level=DEBUG  logger=org.springframework.cloud.kubernetes.commons.config.reload.ConfigReloadUtil message=found change in : KubernetesClientConfigMapPropertySource@1074030799 {name='configmap.app-config-overrides.spring-apps', properties={springapp.cm.directMessage=ConfigMap: Hello!!!, springapp.cm.appYamlMessage=ConfigMap: Hello v1!!!}}
2025-01-17 18:43:28 level=INFO   logger=org.springframework.cloud.kubernetes.commons.config.reload.ConfigReloadUtil message=Detected change in config maps/secrets, reload will ne triggered
2025-01-17 18:43:28 level=INFO   logger=org.springframework.cloud.kubernetes.commons.config.reload.PollingConfigMapChangeDetector message=Detected change in config maps
2025-01-17 18:43:28 level=INFO   logger=org.springframework.cloud.kubernetes.commons.config.reload.ConfigurationChangeDetector message=Reloading using strategy: REFRESH

However, I would like to have different config-maps for different environments like test and prod. But it looks like org.springframework.cloud.kubernetes.commons.config.reload.ConfigReloadUtil does not use the spring.cloud.kubernetes.config.name or spring.cloud.kubernetes.config.sources[].name from environment specific yml files. When I remove the config.name from application.yml and add the same (and/or config.sources[].name) to environment specific yml file like below, the ConfigReloadUtil does not detect the changes in the config map.

application-dev.yml

spring:
  cloud:
    kubernetes:
      config:
        enabled: true
        name: app-configs-overrides
        sources:
          - name: app-config-overrides

Below log shows the context is not getting reloaded but I have updated the config map.

2025-01-17 18:47:10 level=DEBUG  logger=org.springframework.cloud.kubernetes.client.config.KubernetesClientConfigMapsCache message=Loaded all config maps in namespace 'spring-apps'
2025-01-17 18:47:10 level=WARN   logger=org.springframework.cloud.kubernetes.commons.config.ConfigUtils message=sourceName : spring-configmap-example was requested, but not found in namespace : spring-apps
2025-01-17 18:47:10 level=WARN   logger=org.springframework.cloud.kubernetes.commons.config.ConfigUtils message=sourceName : spring-configmap-example-dev was requested, but not found in namespace : spring-apps
2025-01-17 18:47:10 level=DEBUG  logger=org.springframework.cloud.kubernetes.commons.config.NamedSourceData message=Will return empty source with name : configmap.spring-configmap-example.spring-apps
2025-01-17 18:47:10 level=DEBUG  logger=org.springframework.cloud.kubernetes.commons.config.ConfigMapPropertySourceLocator message=Adding config map property source configmap.spring-configmap-example.spring-apps
2025-01-17 18:47:10 level=DEBUG  logger=org.springframework.cloud.kubernetes.commons.config.ConfigMapPropertySourceLocator message=paths property sources : []
2025-01-17 18:47:10 level=DEBUG  logger=org.springframework.cloud.kubernetes.commons.config.reload.ConfigReloadUtil message=environment from locateMapPropertySources : ApplicationServletEnvironment {activeProfiles=[dev], defaultProfiles=[default], propertySources=[MapPropertySource@393666918 {name='server.ports', properties={local.server.port=8080}}, ConfigurationPropertySourcesPropertySource@34964233 {name='configurationProperties', properties=org.springframework.boot.context.properties.source.SpringConfigurationPropertySources@371887f0}, StubPropertySource@1351092924 {name='servletConfigInitParams', properties=java.lang.Object@3ebc4019}, ServletContextPropertySource@278892812 {name='servletContextInitParams', properties=org.apache.catalina.core.ApplicationContextFacade@63cba3e8}, PropertiesPropertySource@1929808071 {name='systemProperties', properties={java.specification.version=21, sun.jnu.encoding=UTF-8, java.class.path=/Users/bbalu/work/workspace/my-apps/spring-configmap-example/target/classes:/Users/bbalu/work/repo/mvn/org/jetbrains/kotlin/kotlin-stdlib/1.9.25/kotlin-stdlib-1.9.25.jar:/Users/bbalu/work/repo/mvn/org/jetbrains/annotations/13.0/annotations-13.0.jar:/Users/bbalu/work/repo/mvn/org/jetbrains/kotlinx/kotlinx-coroutines-reactor/1.8.1/kotlinx-coroutines-reactor-1.8.1.jar:/Users/bbalu/work/repo/mvn/org/jetbrains/kotlinx/kotlinx-coroutines-core-jvm/1.8.1/kotlinx-coroutines-core-jvm-1.8.1.jar:/Users/bbalu/work/repo/mvn/io/projectreactor/reactor-core/3.7.1/reactor-core-3.7.1.jar:/Users/bbalu/work/repo/mvn/org/reactivestreams/reactive-streams/1.0.4/reactive-streams-1.0.4.jar:/Users/bbalu/work/repo/mvn/org/jetbrains/kotlinx/kotlinx-coroutines-reactive/1.8.1/kotlinx-coroutines-reactive-1.8.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot-starter-web/3.4.1/spring-boot-starter-web-3.4.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot-starter/3.4.1/spring-boot-starter-3.4.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot/3.4.1/spring-boot-3.4.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot-autoconfigure/3.4.1/spring-boot-autoconfigure-3.4.1.jar:/Users/bbalu/work/repo/mvn/jakarta/annotation/jakarta.annotation-api/2.1.1/jakarta.annotation-api-2.1.1.jar:/Users/bbalu/work/repo/mvn/org/yaml/snakeyaml/2.3/snakeyaml-2.3.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot-starter-json/3.4.1/spring-boot-starter-json-3.4.1.jar:/Users/bbalu/work/repo/mvn/com/fasterxml/jackson/core/jackson-databind/2.18.2/jackson-databind-2.18.2.jar:/Users/bbalu/work/repo/mvn/com/fasterxml/jackson/core/jackson-annotations/2.18.2/jackson-annotations-2.18.2.jar:/Users/bbalu/work/repo/mvn/com/fasterxml/jackson/core/jackson-core/2.18.2/jackson-core-2.18.2.jar:/Users/bbalu/work/repo/mvn/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.18.2/jackson-datatype-jdk8-2.18.2.jar:/Users/bbalu/work/repo/mvn/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.18.2/jackson-datatype-jsr310-2.18.2.jar:/Users/bbalu/work/repo/mvn/com/fasterxml/jackson/module/jackson-module-parameter-names/2.18.2/jackson-module-parameter-names-2.18.2.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot-starter-tomcat/3.4.1/spring-boot-starter-tomcat-3.4.1.jar:/Users/bbalu/work/repo/mvn/org/apache/tomcat/embed/tomcat-embed-core/10.1.34/tomcat-embed-core-10.1.34.jar:/Users/bbalu/work/repo/mvn/org/apache/tomcat/embed/tomcat-embed-el/10.1.34/tomcat-embed-el-10.1.34.jar:/Users/bbalu/work/repo/mvn/org/apache/tomcat/embed/tomcat-embed-websocket/10.1.34/tomcat-embed-websocket-10.1.34.jar:/Users/bbalu/work/repo/mvn/org/springframework/spring-web/6.2.1/spring-web-6.2.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/spring-beans/6.2.1/spring-beans-6.2.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/spring-webmvc/6.2.1/spring-webmvc-6.2.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/spring-aop/6.2.1/spring-aop-6.2.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/spring-context/6.2.1/spring-context-6.2.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/spring-expression/6.2.1/spring-expression-6.2.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot-starter-actuator/3.4.1/spring-boot-starter-actuator-3.4.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot-actuator-autoconfigure/3.4.1/spring-boot-actuator-autoconfigure-3.4.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot-actuator/3.4.1/spring-boot-actuator-3.4.1.jar:/Users/bbalu/work/repo/mvn/io/micrometer/micrometer-observation/1.14.2/micrometer-observation-1.14.2.jar:/Users/bbalu/work/repo/mvn/io/micrometer/micrometer-commons/1.14.2/micrometer-commons-1.14.2.jar:/Users/bbalu/work/repo/mvn/io/micrometer/micrometer-jakarta9/1.14.2/micrometer-jakarta9-1.14.2.jar:/Users/bbalu/work/repo/mvn/io/micrometer/micrometer-core/1.14.2/micrometer-core-1.14.2.jar:/Users/bbalu/work/repo/mvn/org/hdrhistogram/HdrHistogram/2.2.2/HdrHistogram-2.2.2.jar:/Users/bbalu/work/repo/mvn/org/latencyutils/LatencyUtils/2.0.3/LatencyUtils-2.0.3.jar:/Users/bbalu/work/repo/mvn/org/springframework/cloud/spring-cloud-starter-kubernetes-client/3.2.0/spring-cloud-starter-kubernetes-client-3.2.0.jar:/Users/bbalu/work/repo/mvn/org/springframework/cloud/spring-cloud-kubernetes-client-discovery/3.2.0/spring-cloud-kubernetes-client-discovery-3.2.0.jar:/Users/bbalu/work/repo/mvn/org/springframework/cloud/spring-cloud-kubernetes-client-autoconfig/3.2.0/spring-cloud-kubernetes-client-autoconfig-3.2.0.jar:/Users/bbalu/work/repo/mvn/org/springframework/cloud/spring-cloud-commons/4.2.0/spring-cloud-commons-4.2.0.jar:/Users/bbalu/work/repo/mvn/org/springframework/security/spring-security-crypto/6.4.2/spring-security-crypto-6.4.2.jar:/Users/bbalu/work/repo/mvn/org/springframework/cloud/spring-cloud-starter-kubernetes-client-config/3.2.0/spring-cloud-starter-kubernetes-client-config-3.2.0.jar:/Users/bbalu/work/repo/mvn/org/springframework/cloud/spring-cloud-kubernetes-client-config/3.2.0/spring-cloud-kubernetes-client-config-3.2.0.jar:/Users/bbalu/work/repo/mvn/org/springframework/cloud/spring-cloud-kubernetes-commons/3.2.0/spring-cloud-kubernetes-commons-3.2.0.jar:/Users/bbalu/work/repo/mvn/org/springframework/cloud/spring-cloud-context/4.2.0/spring-cloud-context-4.2.0.jar:/Users/bbalu/work/repo/mvn/io/kubernetes/client-java/19.0.1/client-java-19.0.1.jar:/Users/bbalu/work/repo/mvn/io/prometheus/simpleclient/0.16.0/simpleclient-0.16.0.jar:/Users/bbalu/work/repo/mvn/io/prometheus/simpleclient_tracer_otel/0.16.0/simpleclient_tracer_otel-0.16.0.jar:/Users/bbalu/work/repo/mvn/io/prometheus/simpleclient_tracer_common/0.16.0/simpleclient_tracer_common-0.16.0.jar:/Users/bbalu/work/repo/mvn/io/prometheus/simpleclient_tracer_otel_agent/0.16.0/simpleclient_tracer_otel_agent-0.16.0.jar:/Users/bbalu/work/repo/mvn/io/prometheus/simpleclient_httpserver/0.16.0/simpleclient_httpserver-0.16.0.jar:/Users/bbalu/work/repo/mvn/io/prometheus/simpleclient_common/0.16.0/simpleclient_common-0.16.0.jar:/Users/bbalu/work/repo/mvn/io/kubernetes/client-java-api/19.0.1/client-java-api-19.0.1.jar:/Users/bbalu/work/repo/mvn/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar:/Users/bbalu/work/repo/mvn/io/swagger/swagger-annotations/1.6.11/swagger-annotations-1.6.11.jar:/Users/bbalu/work/repo/mvn/com/squareup/okhttp3/okhttp/4.11.0/okhttp-4.11.0.jar:/Users/bbalu/work/repo/mvn/com/squareup/okio/okio/3.2.0/okio-3.2.0.jar:/Users/bbalu/work/repo/mvn/com/squareup/okio/okio-jvm/3.2.0/okio-jvm-3.2.0.jar:/Users/bbalu/work/repo/mvn/org/jetbrains/kotlin/kotlin-stdlib-common/1.9.25/kotlin-stdlib-common-1.9.25.jar:/Users/bbalu/work/repo/mvn/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.9.25/kotlin-stdlib-jdk8-1.9.25.jar:/Users/bbalu/work/repo/mvn/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.9.25/kotlin-stdlib-jdk7-1.9.25.jar:/Users/bbalu/work/repo/mvn/com/squareup/okhttp3/logging-interceptor/4.11.0/logging-interceptor-4.11.0.jar:/Users/bbalu/work/repo/mvn/com/google/code/gson/gson/2.11.0/gson-2.11.0.jar:/Users/bbalu/work/repo/mvn/io/gsonfire/gson-fire/1.8.5/gson-fire-1.8.5.jar:/Users/bbalu/work/repo/mvn/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/Users/bbalu/work/repo/mvn/io/kubernetes/client-java-proto/19.0.1/client-java-proto-19.0.1.jar:/Users/bbalu/work/repo/mvn/commons-codec/commons-codec/1.17.1/commons-codec-1.17.1.jar:/Users/bbalu/work/repo/mvn/org/apache/commons/commons-compress/1.26.1/commons-compress-1.26.1.jar:/Users/bbalu/work/repo/mvn/org/apache/commons/commons-lang3/3.17.0/commons-lang3-3.17.0.jar:/Users/bbalu/work/repo/mvn/commons-io/commons-io/2.14.0/commons-io-2.14.0.jar:/Users/bbalu/work/repo/mvn/org/bouncycastle/bcpkix-jdk18on/1.76/bcpkix-jdk18on-1.76.jar:/Users/bbalu/work/repo/mvn/org/bouncycastle/bcutil-jdk18on/1.76/bcutil-jdk18on-1.76.jar:/Users/bbalu/work/repo/mvn/com/google/protobuf/protobuf-java/3.24.3/protobuf-java-3.24.3.jar:/Users/bbalu/work/repo/mvn/org/apache/commons/commons-collections4/4.4/commons-collections4-4.4.jar:/Users/bbalu/work/repo/mvn/org/bitbucket/b_c/jose4j/0.9.3/jose4j-0.9.3.jar:/Users/bbalu/work/repo/mvn/io/kubernetes/client-java-extended/19.0.1/client-java-extended-19.0.1.jar:/Users/bbalu/work/repo/mvn/io/kubernetes/client-java-api-fluent/19.0.1/client-java-api-fluent-19.0.1.jar:/Users/bbalu/work/repo/mvn/com/github/vladimir-bukhtoyarov/bucket4j-core/7.6.0/bucket4j-core-7.6.0.jar:/Users/bbalu/work/repo/mvn/com/flipkart/zjsonpatch/zjsonpatch/0.4.14/zjsonpatch-0.4.14.jar:/Users/bbalu/work/repo/mvn/com/github/ben-manes/caffeine/caffeine/3.1.8/caffeine-3.1.8.jar:/Users/bbalu/work/repo/mvn/org/checkerframework/checker-qual/3.37.0/checker-qual-3.37.0.jar:/Users/bbalu/work/repo/mvn/com/google/errorprone/error_prone_annotations/2.21.1/error_prone_annotations-2.21.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/cloud/spring-cloud-starter/4.2.0/spring-cloud-starter-4.2.0.jar:/Users/bbalu/work/repo/mvn/org/bouncycastle/bcprov-jdk18on/1.78.1/bcprov-jdk18on-1.78.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/boot/spring-boot-starter-log4j2/3.4.1/spring-boot-starter-log4j2-3.4.1.jar:/Users/bbalu/work/repo/mvn/org/apache/logging/log4j/log4j-api/2.20.0/log4j-api-2.20.0.jar:/Users/bbalu/work/repo/mvn/org/apache/logging/log4j/log4j-core/2.20.0/log4j-core-2.20.0.jar:/Users/bbalu/work/repo/mvn/org/apache/logging/log4j/log4j-slf4j-impl/2.20.0/log4j-slf4j-impl-2.20.0.jar:/Users/bbalu/work/repo/mvn/org/apache/logging/log4j/log4j-slf4j2-impl/2.24.3/log4j-slf4j2-impl-2.24.3.jar:/Users/bbalu/work/repo/mvn/org/apache/logging/log4j/log4j-jul/2.24.3/log4j-jul-2.24.3.jar:/Users/bbalu/work/repo/mvn/org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar:/Users/bbalu/work/repo/mvn/org/slf4j/jul-to-slf4j/2.0.16/jul-to-slf4j-2.0.16.jar:/Users/bbalu/work/repo/mvn/jakarta/json/jakarta.json-api/2.1.3/jakarta.json-api-2.1.3.jar:/Users/bbalu/work/repo/mvn/org/springframework/spring-core/6.2.1/spring-core-6.2.1.jar:/Users/bbalu/work/repo/mvn/org/springframework/spring-jcl/6.2.1/spring-jcl-6.2.1.jar, java.vm.vendor=Eclipse Adoptium, sun.arch.data.model=64, java.vendor.url=https://adoptium.net/, catalina.useNaming=false, user.timezone=America/Chicago, java.vm.specification.version=21, os.name=Mac OS X, APPLICATION_NAME=spring-configmap-example, sun.java.launcher=SUN_STANDARD, user.country=US, sun.boot.library.path=/Users/bbalu/work/repo/gradle/jdks/eclipse_adoptium-21-aarch64-os_x.2/jdk-21.0.5+11/Contents/Home/lib, spring.application.admin.enabled=true, sun.java.command=my.test.spring.cm.ApplicationKt, com.sun.management.jmxremote=, http.nonProxyHosts=local|*.local|169.254/16|*.169.254/16, jdk.debug=release, spring.liveBeansView.mbeanDomain=, sun.cpu.endian=little, user.home=/Users/bbalu, user.language=en, sun.stderr.encoding=UTF-8, java.specification.vendor=Oracle Corporation, java.version.date=2024-10-15, java.home=/Users/bbalu/work/repo/gradle/jdks/eclipse_adoptium-21-aarch64-os_x.2/jdk-21.0.5+11/Contents/Home, spring.profiles.active=dev, spring.output.ansi.enabled=always, file.separator=/, java.vm.compressedOopsMode=Zero based, sun.stdout.encoding=UTF-8, line.separator=
, java.vm.specification.vendor=Oracle Corporation, java.specification.name=Java Platform API Specification, FILE_LOG_CHARSET=UTF-8, java.awt.headless=true, apple.awt.application.name=ApplicationKt, sun.management.compiler=HotSpot 64-Bit Tiered Compilers, ftp.nonProxyHosts=local|*.local|169.254/16|*.169.254/16, java.runtime.version=21.0.5+11-LTS, user.name=bbalu, spring.jmx.enabled=true, stdout.encoding=UTF-8, path.separator=:, management.endpoints.jmx.exposure.include=*, os.version=15.2, java.runtime.name=OpenJDK Runtime Environment, file.encoding=UTF-8, java.vm.name=OpenJDK 64-Bit Server VM, java.vendor.version=Temurin-21.0.5+11, java.vendor.url.bug=https://github.com/adoptium/adoptium-support/issues, java.io.tmpdir=/var/folders/7f/65xw8t514vn93l5sfs67vgch0000gp/T/, catalina.home=/private/var/folders/7f/65xw8t514vn93l5sfs67vgch0000gp/T/tomcat.8080.9396860844211928285, java.version=21.0.5, user.dir=/Users/bbalu/work/workspace/my-apps/spring-configmap-example, os.arch=aarch64, java.vm.specification.name=Java Virtual Machine Specification, PID=49574, CONSOLE_LOG_CHARSET=UTF-8, catalina.base=/private/var/folders/7f/65xw8t514vn93l5sfs67vgch0000gp/T/tomcat.8080.9396860844211928285, native.encoding=UTF-8, java.library.path=/Users/bbalu/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:., java.vm.info=mixed mode, emulated-client, sharing, stderr.encoding=UTF-8, java.vendor=Eclipse Adoptium, java.vm.version=21.0.5+11-LTS, java.rmi.server.randomIDs=true, sun.io.unicode.encoding=UnicodeBig, socksNonProxyHosts=local|*.local|169.254/16|*.169.254/16, java.class.version=65.0, LOGGED_APPLICATION_NAME=[spring-configmap-example] }}, OriginAwareSystemEnvironmentPropertySource@803643958 {name='systemEnvironment', properties={HOMEBREW_PREFIX=/opt/homebrew, GOPATH=/Users/bbalu/work/runtimes/go/1.16.1, MANPATH=/opt/homebrew/share/man::, COMMAND_MODE=unix2003, INFOPATH=/opt/homebrew/share/info:, SHELL=/bin/zsh, TMPDIR=/var/folders/7f/65xw8t514vn93l5sfs67vgch0000gp/T/, __CFBundleIdentifier=com.jetbrains.intellij, TOMCAT_HOME=/Users/bbalu/work/servers/tomcat-8.0.26-x64, HOME=/Users/bbalu, HOMEBREW_REPOSITORY=/opt/homebrew, GEMFIRE=/Users/bbalu/work/servers/gemfire_820_b17919_linux, TOOLS_HOME=/Users/bbalu/work/tools, PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/usr/local/sbin:/Users/bbalu/work/bin:/Users/bbalu/.local/bin:/Users/bbalu/work/runtimes/android/sdk/platform-tools:/Users/bbalu/work/runtimes/android/cmdline-tools/bin:/Users/bbalu/work/runtimes/go/1.16.1/bin:/Users/bbalu/work/db/neo4j/5.25.1/bin:/Users/bbalu/work/tools/kafka/2.4.0/bin:/Users/bbalu/work/tools/apache-axis2/1.7.5/bin:/Users/bbalu/work/db/apache-cassandra/3.11.14/bin:/Users/bbalu/work/tools/apache-cxf/3.1.12/bin:/Users/bbalu/work/tools/aws_key_gen/0.11.2:/Users/bbalu/work/tools/aws-cli/2.22.32/bin:/Users/bbalu/work/tools/aws-sm/bin:/Applications/Docker.app/Contents/Resources/bin/:/Users/bbalu/work/tools/egctl/1.35.0:/Users/bbalu/work/tools/elasticsearch/8.8.1/bin:/Users/bbalu/work/tools/gradle/7.6/bin:/Users/bbalu/work/tools/grpcui/1.3.1:/Users/bbalu/work/tools/helm/3.12.0/bin:/Users/bbalu/work/tools/kibana/7.17.7/bin:/Users/bbalu/work/tools/kubectl/v1.15.12:/Users/bbalu/work/tools/apache-maven/3.6.3/bin:/Users/bbalu/work/tools/memgraph/console/1.4.0:/Users/bbalu/work/tools/minikube/v1.34.0:/Users/bbalu/work/tools/pnpm/9.4.0/bin:/Users/bbalu/work/tools/prism-x64:/Users/bbalu/work/tools/protobuf/3.11.4:/Users/bbalu/work/tools/redis/6.0.6/bin:/Users/bbalu/work/tools/terraform/0.14.7:/Users/bbalu/work/tools/vcert/v5.1.1:/Users/bbalu/work/tools/visualvm/2.1.10/bin:/Users/bbalu/work/tools/yarn/1.16.0/bin:/Users/bbalu/work/tools/zipkin/2.23.2/bin:/Users/bbalu/work/servers/servicemix-7.0.1/bin:/Users/bbalu/work/servers/gemfire_820_b17919_linux/bin:/Users/bbalu/work/workspace/tls/lpas/lpas-grid/src:/Users/bbalu/.local/bin, LOGNAME=bbalu, DB_HOME=/Users/bbalu/work/db, SERVICEMIX_HOME=/Users/bbalu/work/servers/servicemix-7.0.1, __CF_USER_TEXT_ENCODING=0x1F6:0x0:0x0, XPC_FLAGS=0x0, spring.cloud.kubernetes.client.namespace=spring-apps, SOURCE_ROOT=/Users/bbalu/work/workspace/tls/lpas/lpas-grid, P4CONFIG=/Users/bbalu/work/bin/p4.ini, LC_CTYPE=en_US.UTF-8, GRADLE_USER_HOME=/Users/bbalu/work/repo/gradle, CATALINA_HOME=/Users/bbalu/work/servers/tomcat-8.0.26-x64, GEMFIRE_BASE=/Users/bbalu/work/servers/gemfire_820_b17919_linux/deploy, WORK_BIN=/Users/bbalu/work/bin, SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.rcHYvfWEr0/Listeners, OLDPWD=/, WORK_HOME=/Users/bbalu/work, XPC_SERVICE_NAME=application.com.jetbrains.intellij.759892.759898, spring_debug=-Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005", USER=bbalu, HOMEBREW_CELLAR=/opt/homebrew/Cellar, GRADLE_HOME=/Users/bbalu/work/tools/gradle/7.6, PWD=/Users/bbalu/work/workspace/my-apps/spring-configmap-example}}, RandomValuePropertySource@538801132 {name='random', properties=java.util.Random@9208a31}, CachedRandomPropertySource@1340311644 {name='cachedrandom', properties=RandomValuePropertySource@538801132 {name='random', properties=java.util.Random@9208a31}}, OriginTrackedMapPropertySource@1906400407 {name='Config resource 'class path resource [application-dev.yml]' via location 'optional:classpath:/'', properties={spring.cloud.kubernetes.config.enabled=true, spring.cloud.kubernetes.config.name=app-configs-overrides, spring.cloud.kubernetes.config.sources[0].name=app-config-overrides}}, CompositePropertySource {name='composite-configmap', propertySources=[KubernetesClientConfigMapPropertySource@988336988 {name='configmap.spring-configmap-example.spring-apps', properties={}}]}, CompositePropertySource {name='composite-secrets', propertySources=[]}, OriginTrackedMapPropertySource@932489010 {name='Config resource 'class path resource [application.yml]' via location 'optional:classpath:/'', properties={spring.main.cloud-platform=kubernetes, spring.application.name=spring-configmap-example, spring.profiles.active=dev, spring.cloud.kubernetes.config.namespace=spring-apps, spring.cloud.kubernetes.reload.enabled=true, spring.cloud.kubernetes.reload.monitoring-config-maps=true, spring.cloud.kubernetes.reload.strategy=refresh, spring.cloud.kubernetes.reload.mode=polling, spring.config.import=kubernetes:, springapp.cm.direct-message=YAML: Hello!!!, springapp.cm.app-yaml-message=YAML: Hello!!!, springapp.cm.numberVar=2, springapp.cm.numberVal=2, management.endpoints.web.exposure.include=info,health,metrics,loggers,refresh,beans,heapdump}}, MapPropertySource@1692821748 {name='springCloudClientHostInfo', properties={spring.cloud.client.hostname=172.17.40.151, spring.cloud.client.ip-address=172.17.40.151}}, ApplicationInfoPropertySource@525915419 {name='applicationInfo', properties={spring.application.pid=49574}}, @1902707184 {name='Management Server', properties=java.lang.Object@261f76e1}]}
2025-01-17 18:47:10 level=DEBUG  logger=org.springframework.cloud.kubernetes.commons.config.reload.ConfigReloadUtil message=sources from locateMapPropertySources : [KubernetesClientConfigMapPropertySource@688892737 {name='configmap.spring-configmap-example.spring-apps', properties={}}]
2025-01-17 18:47:10 level=DEBUG  logger=org.springframework.cloud.kubernetes.commons.config.reload.ConfigReloadUtil message=no changes found, reload will not happen
2025-01-17 18:47:10 level=DEBUG  logger=org.springframework.cloud.kubernetes.commons.config.reload.ConfigReloadUtil message=Reloadable condition was not satisfied, reload will not be triggered

Could someone please help me fix this issue?

Environment:

Java: 21.0.2
Spring: 6.2.1
Spring Boot: 3.4.1
Spring Cloud kube client: 3.2.0

Sample
Link to sample app: https://gitlab.com/baji/spring-configmap-example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants