diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index 71bb002ef2..207780b345 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -51,6 +51,15 @@ app.kubernetes.io/name: {{ include "mastodon.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} +{{/* +Rolling pod annotations +*/}} +{{- define "mastodon.rollingPodAnnotations" -}} +rollme: {{ .Release.Revision | quote }} +checksum/config-secrets: {{ include ( print $.Template.BasePath "/secrets.yaml" ) . | sha256sum | quote }} +checksum/config-configmap: {{ include ( print $.Template.BasePath "/configmap-env.yaml" ) . | sha256sum | quote }} +{{- end }} + {{/* Create the name of the service account to use */}} diff --git a/chart/templates/deployment-sidekiq.yaml b/chart/templates/deployment-sidekiq.yaml index dd707a4d04..57051870f8 100644 --- a/chart/templates/deployment-sidekiq.yaml +++ b/chart/templates/deployment-sidekiq.yaml @@ -16,11 +16,11 @@ spec: template: metadata: annotations: - {{- with .Values.podAnnotations }} + {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} - {{- end }} - # roll the pods to pick up any db migrations - rollme: {{ randAlphaNum 5 | quote }} + {{- end }} + # roll the pods to pick up any db migrations or other changes + {{- include "mastodon.rollingPodAnnotations" . | nindent 8 }} labels: {{- include "mastodon.selectorLabels" . | nindent 8 }} app.kubernetes.io/component: sidekiq diff --git a/chart/templates/deployment-streaming.yaml b/chart/templates/deployment-streaming.yaml index 7f03c9e23e..a5007222c2 100644 --- a/chart/templates/deployment-streaming.yaml +++ b/chart/templates/deployment-streaming.yaml @@ -14,10 +14,12 @@ spec: app.kubernetes.io/component: streaming template: metadata: - {{- with .Values.podAnnotations }} annotations: + {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} + # roll the pods to pick up any db migrations or other changes + {{- include "mastodon.rollingPodAnnotations" . | nindent 8 }} labels: {{- include "mastodon.selectorLabels" . | nindent 8 }} app.kubernetes.io/component: streaming diff --git a/chart/templates/deployment-web.yaml b/chart/templates/deployment-web.yaml index fb58b1ade0..23d4676b3d 100644 --- a/chart/templates/deployment-web.yaml +++ b/chart/templates/deployment-web.yaml @@ -19,8 +19,8 @@ spec: {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} - # roll the pods to pick up any db migrations - rollme: {{ randAlphaNum 5 | quote }} + # roll the pods to pick up any db migrations or other changes + {{- include "mastodon.rollingPodAnnotations" . | nindent 8 }} labels: {{- include "mastodon.selectorLabels" . | nindent 8 }} app.kubernetes.io/component: web