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

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

Closed
Famezyy opened this issue Dec 24, 2023 · 5 comments
Closed

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

Famezyy opened this issue Dec 24, 2023 · 5 comments
Milestone

Comments

@Famezyy
Copy link

Famezyy commented Dec 24, 2023

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.

@Famezyy Famezyy changed the title configuring "spring.cloud.kubernetes.secret.apps" is not working Configuring "spring.cloud.kubernetes.secret.apps" is not working Dec 24, 2023
@wind57
Copy link
Contributor

wind57 commented Dec 24, 2023

A couple of things...

  1. we have an exact integration test around this functionality that passes, so this is a bit weird.
  2. The logs look kind of off and they are present in a different class and look a little different too. Do you see such a log statement in your configuration watcher? Also, what version of configuration watcher are you deploying?
will schedule remote refresh based on apps :
  1. The only real way to help you here is if you can help me. The way to do this is for you to provide a minimal reproducible example: every app that you use, every manifest that you use to deploy the app, etc. That way, I can replicate your problem and help a lot more.

@Famezyy
Copy link
Author

Famezyy commented Dec 24, 2023

I was using version 2.0.1 as mentioned in the official documentation. When you asked about the version of the Watcher, it suddenly occurred to me that the version given in the documentation might be outdated and incompatible. And that's indeed the case, after updating to version 3.1.0, everything is now working fine!

Sorry for the fuss, and thank you for the prompt reply!

@Famezyy Famezyy closed this as completed Dec 24, 2023
@wind57
Copy link
Contributor

wind57 commented Dec 24, 2023

Awesome! Please dont hesitate to ask any more questions if needed.

@ryanjbaxter
Copy link
Contributor

@Famezyy can you give a link to the docs you were referring to?

@Famezyy
Copy link
Author

Famezyy commented Dec 24, 2023

@ryanjbaxter sure, below is the link I was looking into:
Spring Cloud Kubernetes Configuration Watcher

the image version is mentioned as 2.0.1-SNAPSHOT:

...
containers:
- name: spring-cloud-kubernetes-configuration-watcher
  image: springcloud/spring-cloud-kubernetes-configuration-watcher:2.0.1-SNAPSHOT
  imagePullPolicy: IfNotPresent
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants