Rodrigo
Rodrigo

Reputation: 291

Reload pod when secret changes

Let's say that I have a running pod named my-pod

my-pod reads the secrets from foobar-secrets

Now let's say that I update some value in foobar-secrets

kubectl patch secret foobar-secrets --namespace kube-system --context=cluster-1 --patch "{\"data\": {\"FOOBAR\": \"$FOOBAR_BASE64\"}}"

What I should do to restart/reload the pod in order to get the new value?

Upvotes: 0

Views: 2413

Answers (1)

coderanger
coderanger

Reputation: 54181

https://github.com/stakater/Reloader is the usual solution for a fully standalone setup. Another option is https://github.com/jimmidyson/configmap-reload or similar but that requires coordination with the daemon process to have an API of some kind for reloading.

Upvotes: 2

Related Questions