Skip to content

Commit

Permalink
Auto restart deployment on config change (#450)
Browse files Browse the repository at this point in the history
Add new restartOnConfigChange property.

This will cause the deployment to be restarted if the config is changed,
e.g. the set of plans or device modules are updated, when running
helm upgrade.

Use a variation of approach at:

https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments

Fixes 451.
  • Loading branch information
joeshannon authored May 2, 2024
1 parent 25e9028 commit 9964a65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion helm/blueapi/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ spec:
{{- include "blueapi.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- if .Values.restartOnConfigChange }}
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- end }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
Expand Down
2 changes: 2 additions & 0 deletions helm/blueapi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ affinity: {}

hostNetwork: false # May be needed for talking to arcane protocols such as EPICS

restartOnConfigChange: true

listener:
enabled: true
resources: {}
Expand Down

0 comments on commit 9964a65

Please sign in to comment.