Skip to content

Commit b64c882

Browse files
committed
Automaticalla restart adminer pods on network policy change
1 parent 05adb57 commit b64c882

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

charts/adminer/templates/deployment.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ spec:
1313
{{- include "adminer.selectorLabels" . | nindent 6 }}
1414
template:
1515
metadata:
16-
{{- with .Values.podAnnotations }}
16+
{{- if .Values.podAnnotations }}
1717
annotations:
18-
{{- toYaml . | nindent 8 }}
18+
# allow dynamic values in pod annotations
19+
{{- tpl (toYaml .Values.podAnnotations) . | nindent 8 }}
1920
{{- end }}
2021
labels:
2122
{{- include "adminer.labels" . | nindent 8 }}

charts/adminer/values.yaml.gotmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ serviceAccount:
2525
# If not set and create is true, a name is generated using the fullname template
2626
name: ""
2727

28-
podAnnotations: {}
28+
podAnnotations:
29+
# automatically restart pod on network policy change (to be sure new rules are applied)
30+
checksum/networkpolicy: '{{`{{ include (print $.Template.BasePath "/networkpolicy.yaml") . | sha256sum }}`}}'
2931
podLabels: {}
3032

3133
podSecurityContext:

0 commit comments

Comments
 (0)