diff --git a/docs/charts_tips_and_tricks.md b/docs/charts_tips_and_tricks.md index 2b1e975e1068be616d1d9e08a0708f6113c824bf..e97b560ce6ce758d28bf699f3ee067b4037ad337 100644 --- a/docs/charts_tips_and_tricks.md +++ b/docs/charts_tips_and_tricks.md @@ -61,6 +61,29 @@ Because YAML ascribes significance to indentation levels and whitespace, this is one great way to include snippets of code, but handle indentation in a relevant context. +## Automatically Roll Deployments When ConfigMaps or Secrets change + +Often times configmaps or secrets are injected as configuration +files in containers. +Depending on the application a restart may be required should those +be updated with a subsequent `helm upgrade`, but if the +deployment spec itself didn't change the application keeps running +with the old configuration resulting in an inconsistent deployment. + +The `sha256sum` function can be used together with the `include` +function to ensure a deployments template section is updated if another +spec changes: + +``` +kind: Deployment +spec: + template: + metadata: + annotations: + checksum/config: {{ include "mychart/templates/configmap.yaml" . | sha256sum }} +[...] +``` + ## Using "Partials" and Template Includes Sometimes you want to create some reusable parts in your chart, whether diff --git a/glide.lock b/glide.lock index e777b53a7c34bace682d43a918d5aacd06adbd37..55a83c7b78de4a0fba67ea3dbfdceb4a2e582f0f 100644 --- a/glide.lock +++ b/glide.lock @@ -201,7 +201,7 @@ imports: - name: github.com/Masterminds/semver version: 52edfc04e184ecf0962489d167b511b27aeebd61 - name: github.com/Masterminds/sprig - version: 8f797f5b23118d8fe846c4296b0ad55044201b14 + version: 3fb136ad254dd34998b95f8d523b09a0dafa31b5 - name: github.com/mattn/go-runewidth version: d6bea18f789704b5f83375793155289da36a3c7f - name: github.com/pborman/uuid