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

Annotation(s) for additional CMs/Secrets to watch #98

Closed
aaron-trout opened this issue Mar 18, 2021 · 4 comments · Fixed by #164
Closed

Annotation(s) for additional CMs/Secrets to watch #98

aaron-trout opened this issue Mar 18, 2021 · 4 comments · Fixed by #164
Labels
enhancement New feature or request Stale

Comments

@aaron-trout
Copy link

aaron-trout commented Mar 18, 2021

I have an initContainer on one of my deployments which reads stuff directly from a Kubernetes Secret. This doesn't currently get picked up by Wave because that Secret is not in any volumes or env/envFrom.

It would be handy if there was an optional annotation to specify extra configmaps / secrets to watch. Something like:

annotations:
  wave.pusher.com/update-on-config-change: "true"
  wave.pusher.com/extra-configmaps: "some-namespace/my-configmap"
  wave.pusher.com/extra-secrets: "some-namespace/my-secret,some-other-namespace/foo"

For now, I have worked around this by defining a Volume but not actually mounting it into any containers in the pod.

@wonderhoss
Copy link
Collaborator

This sounds to me like a fairly niche use case. Also, adding watches across namespaces like you suggest would complicate things a lot.

If there is more interest in this functionality, we might revisit this, but for now the approach you have taken, defining a volume without mounting it is a reasonable workaround.
I might add that to the documentation as a supported way of capturing such "rogue" ConfigMaps or Secrets.

@wonderhoss wonderhoss added the enhancement New feature or request label Mar 30, 2021
@github-actions
Copy link

This issue has been inactive for 60 days. If the issue is still relevant please comment to re-activate the issue. If no action is taken within 7 days, the issue will be marked closed.

@github-actions github-actions bot added the Stale label May 30, 2021
@github-actions github-actions bot closed this as completed Jun 7, 2021
@toelke toelke reopened this Feb 12, 2024
@jabdoa2
Copy link
Contributor

jabdoa2 commented Apr 27, 2024

If anybody want to implement it this should be quite straightforward to do. Just add the query here: https://github.com/wave-k8s/wave/blob/master/pkg/core/children.go#L53 in getCurrentChildren. That should add owner references etc and trigger all the magic. Not sure if cross namespace watches would actually be an issue with owner refs.

Workaround for now would be to add those secrets/configmaps as (unused) environment variables.

@jabdoa2
Copy link
Contributor

jabdoa2 commented Apr 30, 2024

In #155 I refactored the children code to support secrets/configmaps in other namespaces. This should be quite straightforward to implement now. Let me know if you still need it and I will add it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants