diff --git a/README.md b/README.md index c003978..e1f2acd 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,33 @@ spec: This will discover deployments/daemonsets/statefulset automatically where `foo-configmap` or `foo-secret` is being used either via environment variable or from volume mount. And it will perform rolling upgrade on related pods when `foo-configmap` or `foo-secret`are updated. +You can restrict this discovery to only `ConfigMap` or `Secret` objects that +are tagged with a special annotation. To take advantage of that, annotate +your deployment/daemonset/statefulset like this: + +```yaml +kind: Deployment +metadata: + annotations: + reloader.stakater.com/search: "true" +spec: + template: +``` + +and Reloader will trigger the rolling upgrade when any `ConfigMap` or `Secret` annotated like this: +and then annotate your `ConfigMap` or `Secret` so: + +```yaml +kind: ConfigMap +metadata: + annotations: + reloader.stakater.com/match: "true" +data: + key: value +``` + +is modified, provided it is being used in an environment variable or a volume mount. + We can also specify a specific configmap or secret which would trigger rolling upgrade only upon change in our specified configmap or secret, this way, it will not trigger rolling upgrade upon changes in all configmaps or secrets used in a deployment, daemonset or statefulset. To do this either set the auto annotation to `"false"` (`reloader.stakater.com/auto: "false"`) or remove it altogether, and use annotations mentioned [here](#Configmap) or [here](#Secret) @@ -99,6 +126,8 @@ spec: - `reloader.stakater.com/auto: "true"` will only reload the pod, if the configmap or secret is used (as a volume mount or as an env) in `DeploymentConfigs/Deployment/Daemonsets/Statefulsets` - `secret.reloader.stakater.com/reload` or `configmap.reloader.stakater.com/reload` annotation will reload the pod upon changes in specified configmap or secret, irrespective of the usage of configmap or secret. - you may override the auto annotation with the `--auto-annotation` flag +- you may override the search annotation with the `--auto-search-annotation` flag + and the match annotation with the `--search-match-annotation` flag - you may override the configmap annotation with the `--configmap-annotation` flag - you may override the secret annotation with the `--secret-annotation` flag - you may want to prevent watching certain namespaces with the `--namespaces-to-ignore` flag