[Issue-520] tolerations for csi-daemonset (#521)
Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
This commit is contained in:
parent
e817b1d254
commit
0ab15dfb84
4 changed files with 38 additions and 0 deletions
|
@ -502,6 +502,16 @@ Sets extra CSI daemonset annotations
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Sets the injector toleration for pod placement
|
||||||
|
*/}}
|
||||||
|
{{- define "csi.pod.tolerations" -}}
|
||||||
|
{{- if .Values.csi.pod.tolerations }}
|
||||||
|
tolerations:
|
||||||
|
{{ tpl .Values.csi.pod.tolerations . | nindent 8 | trim }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Sets extra CSI provider pod annotations
|
Sets extra CSI provider pod annotations
|
||||||
*/}}
|
*/}}
|
||||||
|
|
|
@ -28,6 +28,7 @@ spec:
|
||||||
{{ template "csi.pod.annotations" . }}
|
{{ template "csi.pod.annotations" . }}
|
||||||
spec:
|
spec:
|
||||||
serviceAccountName: {{ template "vault.fullname" . }}-csi-provider
|
serviceAccountName: {{ template "vault.fullname" . }}-csi-provider
|
||||||
|
{{- template "csi.pod.tolerations" . }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ include "vault.name" . }}-csi-provider
|
- name: {{ include "vault.name" . }}-csi-provider
|
||||||
{{ template "csi.resources" . }}
|
{{ template "csi.resources" . }}
|
||||||
|
|
|
@ -206,6 +206,27 @@ load _helpers
|
||||||
[ "${actual}" = "bar" ]
|
[ "${actual}" = "bar" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "csi/daemonset: tolerations not set by default" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
--show-only templates/csi-daemonset.yaml \
|
||||||
|
--set 'csi.enabled=true' \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq '.spec.template.spec | .tolerations? == null' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "true" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "csi/daemonset: tolerations can be set" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
--show-only templates/csi-daemonset.yaml \
|
||||||
|
--set 'csi.enabled=true' \
|
||||||
|
--set 'csi.pod.tolerations=foobar' \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq '.spec.template.spec.tolerations == "foobar"' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "true" ]
|
||||||
|
}
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# volumes
|
# volumes
|
||||||
|
|
||||||
|
|
|
@ -728,12 +728,18 @@ csi:
|
||||||
# YAML-formatted multi-line templated string map of the annotations to apply
|
# YAML-formatted multi-line templated string map of the annotations to apply
|
||||||
# to the daemonSet.
|
# to the daemonSet.
|
||||||
annotations: {}
|
annotations: {}
|
||||||
|
|
||||||
pod:
|
pod:
|
||||||
# Extra annotations for the provider pods. This can either be YAML or a
|
# Extra annotations for the provider pods. This can either be YAML or a
|
||||||
# YAML-formatted multi-line templated string map of the annotations to apply
|
# YAML-formatted multi-line templated string map of the annotations to apply
|
||||||
# to the pod.
|
# to the pod.
|
||||||
annotations: {}
|
annotations: {}
|
||||||
|
|
||||||
|
# Toleration Settings for provider pods
|
||||||
|
# This should be a multi-line string matching the Toleration array
|
||||||
|
# in a PodSpec.
|
||||||
|
tolerations: null
|
||||||
|
|
||||||
serviceAccount:
|
serviceAccount:
|
||||||
# Extra annotations for the serviceAccount definition. This can either be
|
# Extra annotations for the serviceAccount definition. This can either be
|
||||||
# YAML or a YAML-formatted multi-line templated string map of the
|
# YAML or a YAML-formatted multi-line templated string map of the
|
||||||
|
|
Loading…
Reference in a new issue