-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Version
Java version 11
Kubernetes version 1.21.7
Version after upgrade [issue found]
Spring Boot 2.6.2
Spring Cloud 2021.0.1
Version before upgrade [works fine]
Spring Boot 2.5.3
Spring Cloud 2020.0.3
Describe the bug
We're developing Spring boot backend project and deploy to Kubernetes. There are 2 pods (I'll call them Microservice A and Microservice B) being deployed in the same namespace. Each Microservice have a K8s secrets corresponding to them(which also are in the same namespace). Before upgrading to Spring Boot 2.6.2 and Spring Cloud 2021.0.1, the secrets properties source works correct but after upgrading both A and B, secrets value of Microservice B is injected to Microservice A instead.
Microservice A
Secret
- name : a-service-oauth
data:
oauth2.client_id: aaaaa_id
oauth2.client_secret: aaaaa_secret
- name : a-mongodb
data:
url: aaaaa_url
bootstrap.yaml
spring:
application:
name: a
...
cloud:
kubernetes:
reload:
enabled: true
monitoring-secrets: true
secrets:
enable-api: true
sources:
- name: a-mongodb
- name: a-service-oauth
enabled: true
...
Microservice B
Secret
- name : b-service-oauth
- data:
oauth2.client_id: bbbbb_id
oauth2.client_secret: bbbbb_secret
- name : b-mongodb
data:
url: bbbbb_url
bootstrap.yaml
spring:
application:
name: a
...
cloud:
kubernetes:
reload:
enabled: true
monitoring-secrets: true
secrets:
enable-api: true
sources:
- name: b-mongodb
- name: b-service-oauth
enabled: true
When i investigated bug. I checked the value by exposing via actuator endpoint(/actuator/configprops).

I notice 2 things that incorrect
- Value of client id is
bbbbb_idwhich suppose to beaaaaa_id - In
origin, it shows that value are from secret namea-mongodbwhich suppose bea-service-oauth.
After I downgrade and check these values that expose via actuator. They are correct.
If any information further is required, please let me know thanks!