Configure Resources with Reloader
Reloader uses a set of annotations to determine which resources need to be watched and correspondingly which resources need to be restarted if a change is detected.
Auto Detect Resources
Most commonly used annotation is
reloader.stakater.com/auto: "true". This will discover all the secrets and configmaps which are used either via environment variable or from volume mount in the deploymentconfigs/deployments/daemonsets/statefulset/rollouts, and it will perform rolling upgrade on related pods when the watched resources are updated.
Restrict Auto Discovery
You can restrict this discovery to only
Secret objects that
are tagged with a special annotation. To take advantage of that, annotate
your deploymentconfigs/deployments/daemonsets/statefulset/rollouts like this:
and Reloader will trigger the rolling upgrade upon modification of any
Secret annotated like this:
provided the secret/configmap is being used in an environment variable, or a volume mount.
Reload on Specific Resources
To perform rolling upgrade when change happens only on specific configmaps or secrets, the annotation
configmap.reloader.stakater.com/reload: "<secret1-name>/<configmap1-name>, <secret2-name>/<configmap2-name>" can be used, which works on comma-separated names of configmaps or secrets, if multiple.
foo has a
foo-configmap and a secret called
foo-secret. Then add this annotation to the metadata of your
More configurations in which Reloader can be used are mentioned in How to Use Reloader.