Add configmap hashing approach to horizon to allow rolling updates
when configmaps are updated
This commit is contained in:
parent
e85f080b3f
commit
ca2dd29bbd
@ -11,3 +11,14 @@
|
|||||||
{{- $wtf := $context.Template.Name | replace $last $name -}}
|
{{- $wtf := $context.Template.Name | replace $last $name -}}
|
||||||
{{ include $wtf $context }}
|
{{ include $wtf $context }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "hash" -}}
|
||||||
|
{{- $name := index . 0 -}}
|
||||||
|
{{- $context := index . 1 -}}
|
||||||
|
{{- $v:= $context.Template.Name | split "/" -}}
|
||||||
|
{{- $n := len $v -}}
|
||||||
|
{{- $last := sub $n 1 | printf "_%d" | index $v -}}
|
||||||
|
{{- $wtf := $context.Template.Name | replace $last $name -}}
|
||||||
|
{{- include $wtf $context | sha256sum | quote -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
@ -9,6 +9,8 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: horizon
|
app: horizon
|
||||||
annotations:
|
annotations:
|
||||||
|
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }}
|
||||||
|
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }}
|
||||||
pod.beta.kubernetes.io/init-containers: '[
|
pod.beta.kubernetes.io/init-containers: '[
|
||||||
{
|
{
|
||||||
"name": "init",
|
"name": "init",
|
||||||
|
Loading…
Reference in New Issue
Block a user