Skip to content

Commit

Permalink
feat(csi/node): add nvme-tcp init container
Browse files Browse the repository at this point in the history
Adds init container which waits on the nvme-tcp kernel module to be loaded.
It's disabled by default.
todo: use common init container image

Signed-off-by: Tiago Castro <[email protected]>
  • Loading branch information
tiagolobocastro committed Feb 27, 2024
1 parent 2b0e627 commit b3e4952
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions chart/templates/mayastor/csi/csi-node-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b3e4952

Please sign in to comment.