Skip to content

Commit

Permalink
feat(grafana): enable affinity templating
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Tavernier <v.tavernier@pm.me>
  • Loading branch information
alixinne committed May 3, 2022
1 parent 9b2b2c5 commit 20c48f6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion charts/grafana/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,10 @@ containers:
nodeSelector:
{{ toYaml . | indent 2 }}
{{- end }}
{{- $root := . }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 2 }}
{{ tpl (toYaml .) $root | indent 2 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
Expand Down
3 changes: 2 additions & 1 deletion charts/grafana/templates/image-renderer-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,10 @@ spec:
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- $root := . }}
{{- with .Values.imageRenderer.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{ tpl (toYaml .) $root | indent 8 }}
{{- end }}
{{- with .Values.imageRenderer.tolerations }}
tolerations:
Expand Down
3 changes: 2 additions & 1 deletion charts/grafana/templates/tests/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ spec:
nodeSelector:
{{ toYaml . | indent 4 }}
{{- end }}
{{- $root := . }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 4 }}
{{ tpl (toYaml .) $root | indent 4 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
Expand Down
4 changes: 2 additions & 2 deletions charts/grafana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ nodeSelector: {}
##
tolerations: []

## Affinity for pod assignment
## Affinity for pod assignment (evaluated as template)
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
##
affinity: {}
Expand Down Expand Up @@ -846,7 +846,7 @@ imageRenderer:
##
tolerations: []

## Affinity for pod assignment
## Affinity for pod assignment (evaluated as template)
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
##
affinity: {}
Expand Down

0 comments on commit 20c48f6

Please sign in to comment.