diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index d2d71e6e2..4417f0ed3 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -60,6 +60,17 @@ Usage: {{- end }} {{- end -}} +{{/* +Renders the csi node init containers, if enabled +Usage: +{{ include "csi_node_init_containers" . }} +*/}} +{{- define "csi_node_init_containers" -}} + {{- if .Values.csi.node.initContainers.enabled }} + {{- include "render" (dict "value" .Values.csi.node.initContainers.containers "context" $) | nindent 8 }} + {{- end }} +{{- end -}} + {{/* Renders the base image pull secrets for all deployments, if any Usage: diff --git a/chart/templates/mayastor/csi/csi-node-daemonset.yaml b/chart/templates/mayastor/csi/csi-node-daemonset.yaml index 474a1b709..13911dbae 100644 --- a/chart/templates/mayastor/csi/csi-node-daemonset.yaml +++ b/chart/templates/mayastor/csi/csi-node-daemonset.yaml @@ -47,6 +47,8 @@ spec: {{- if $tolerations := include "tolerations" (dict "template" . "localTolerations" .Values.csi.node.tolerations) }} tolerations: {{ $tolerations }} {{- end }} + initContainers: + {{- include "csi_node_init_containers" . }} # NOTE: Each container must have mem/cpu limits defined in order to # belong to Guaranteed QoS class, hence can never get evicted in case of # pressure unless they exceed those limits. limits and requests must be diff --git a/chart/values.yaml b/chart/values.yaml index 4c67ee1ac..d96ac4eab 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -327,6 +327,12 @@ csi: tolerations: [] # -- Set PriorityClass, overrides global priorityClassName: "" + initContainers: + enabled: false + containers: + - name: nvme-tcp-probe + image: busybox:latest + command: ['sh', '-c', 'trap "exit 1" TERM; until $(lsmod | grep nvme_tcp &>/dev/null); do [ -z "$WARNED" ] && echo "nvme_tcp module not loaded..."; WARNED=1; sleep 60; done;'] io_engine: # -- Log level for the io-engine service