[Issue-520] tolerations for csi-daemonset (#521)

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
This commit is contained in:
mehmetsalgar 2021-05-18 02:14:19 +02:00 committed by GitHub
parent e817b1d254
commit 0ab15dfb84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 0 deletions

View file

@ -502,6 +502,16 @@ Sets extra CSI daemonset annotations
{{- 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
*/}}

View file

@ -28,6 +28,7 @@ spec:
{{ template "csi.pod.annotations" . }}
spec:
serviceAccountName: {{ template "vault.fullname" . }}-csi-provider
{{- template "csi.pod.tolerations" . }}
containers:
- name: {{ include "vault.name" . }}-csi-provider
{{ template "csi.resources" . }}

View file

@ -206,6 +206,27 @@ load _helpers
[ "${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

View file

@ -728,12 +728,18 @@ csi:
# YAML-formatted multi-line templated string map of the annotations to apply
# to the daemonSet.
annotations: {}
pod:
# 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
# to the pod.
annotations: {}
# Toleration Settings for provider pods
# This should be a multi-line string matching the Toleration array
# in a PodSpec.
tolerations: null
serviceAccount:
# Extra annotations for the serviceAccount definition. This can either be
# YAML or a YAML-formatted multi-line templated string map of the