fix(chart): Fix gitops-incompatible random rolling (#20184)
This patch reworks the Pod rolling mechanism, which is supposed to update Pods with each migration run, but since the it generates a new random value on each helm execution, this will constantly roll all pods in a GitOps driven deployment, which reconciles the helm release. This is resolved by fixing the upgrade to the `.Release.Revision`, which should stay identical, unless config or helm release version have been changed. Further it introduces automatic rolls based on adjustments to the environment variables and secrets. The implementation uses a helper template, following the 1-2-N rule, and omitting code duplication. References: https://helm.sh/docs/chart_template_guide/builtin_objects/ https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments
This commit is contained in:
parent
86d4b6f7c9
commit
e868f41923
4 changed files with 19 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue