From dce6b647aaa53b1e7cd866d49445207bff4e2b87 Mon Sep 17 00:00:00 2001 From: Fabian Ruff Date: Sat, 19 Nov 2016 00:31:18 +0100 Subject: [PATCH 1/2] Bump sprig, adds sha256sum template function --- glide.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glide.lock b/glide.lock index e5dd9bd7a..c6ee4ade8 100644 --- a/glide.lock +++ b/glide.lock @@ -264,7 +264,7 @@ imports: - name: github.com/Masterminds/semver version: 808ed7761c233af2de3f9729a041d68c62527f3a - name: github.com/Masterminds/sprig - version: 8f797f5b23118d8fe846c4296b0ad55044201b14 + version: 3fb136ad254dd34998b95f8d523b09a0dafa31b5 - name: github.com/mattn/go-runewidth version: d6bea18f789704b5f83375793155289da36a3c7f - name: github.com/matttproud/golang_protobuf_extensions From 335b3806a520e779c0603f79290a35d75a54e1ee Mon Sep 17 00:00:00 2001 From: Fabian Ruff Date: Sat, 19 Nov 2016 00:32:14 +0100 Subject: [PATCH 2/2] Add docs for rolling deployments on config change --- docs/charts_tips_and_tricks.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/charts_tips_and_tricks.md b/docs/charts_tips_and_tricks.md index 2b1e975e1..e97b560ce 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