Skip to content

Configuring "spring.cloud.kubernetes.secret.apps" is not working #1548

@Famezyy

Description

@Famezyy

My application can read the initial value from the Secret when the service starts. However, if I modify the value in the Secret, the application is unable to refresh and recognize the updated value. Below is the Secret manifest that I used:

apiVersion: v1
data:
  db.password: dGVtcFBhc3N3b3Jk
  db.username: cm9vdA==
kind: Secret
metadata:
  name: mysql-root-authn
  namespace: default
  labels:
    spring.cloud.kubernetes.secret: "true"
    spring.cloud.kubernetes.secret.informer.enabled: "true"
  annotations:
    spring.cloud.kubernetes.secret.apps: "cloud-k8s-app"
type: Opaque

I could also see that the Watcher detected the change but it got stuck during scheduling phrase, seems it could not find the service:

2023-12-24 11:30:52.376 DEBUG 1 --- [//10.96.0.1/...] .c.w.HttpBasedSecretsWatchChangeDetector : secrets-watch-event received event for Secret mysql-root-authn
2023-12-24 11:30:52.376 DEBUG 1 --- [//10.96.0.1/...] .c.w.HttpBasedSecretsWatchChangeDetector : Scheduling remote refresh event to be published for Secret mysql-root-authn to be published in 1000 milliseconds

If I hit the "actuator/refresh" endpoint manually then the value can be refreshed. Also if I use the same name for Secret as app name (cloud-k8s-app) then the Watcher can find the app and send refresh request successfully.

Just found the same issue for "spring.cloud.kubernetes.configmap.apps", Watcher can not find the app mentioned in this annotation. the version of spring cloud kubernetes I used was 3.1.0.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions