From 5877ba6fb2505d8f1c02699d401149660be635b1 Mon Sep 17 00:00:00 2001 From: Leo Palmer Date: Thu, 28 Dec 2023 17:08:25 +0100 Subject: [PATCH] Adds custom iSCSIadm ConfigMap and HostPID options Tackles issue #207. Adds the ability to enable HostPID: true for the csi Node DaemonSet. It also adds the ability to inject a custom configuration in to the hardcoded `openebs-jiva-csi-iscsiadm` ConfigMap. These changes are pretty small but ensures that the Jiva Operator can more easily be used with (Talos)[https://www.talos.dev/]. Talos requires some modifications for it to work properly with Talos. Details here: https://www.talos.dev/v1.6/kubernetes-guides/configuration/replicated-local-storage-with-openebs-jiva/#patching-the-jiva-installation Signed-off-by: Leo Palmer Sunmo --- deploy/helm/charts/templates/csi-iscsiadm-config.yaml | 4 ++++ deploy/helm/charts/templates/csi-node.yaml | 1 + deploy/helm/charts/values.yaml | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/deploy/helm/charts/templates/csi-iscsiadm-config.yaml b/deploy/helm/charts/templates/csi-iscsiadm-config.yaml index f25f155..4f9d05c 100644 --- a/deploy/helm/charts/templates/csi-iscsiadm-config.yaml +++ b/deploy/helm/charts/templates/csi-iscsiadm-config.yaml @@ -4,6 +4,9 @@ metadata: name: openebs-jiva-csi-iscsiadm data: iscsiadm: | + {{- if .Values.csiNode.customIscsiadmConfig }} + {{- .Values.csiNode.customIscsiadmConfig | nindent 4 }} + {{- else }} #!/bin/sh if [ -x /host/sbin/iscsiadm ]; then chroot /host /sbin/iscsiadm "$@" @@ -16,3 +19,4 @@ data: else chroot /host iscsiadm "$@" fi + {{- end }} \ No newline at end of file diff --git a/deploy/helm/charts/templates/csi-node.yaml b/deploy/helm/charts/templates/csi-node.yaml index 23c73e7..b34b912 100644 --- a/deploy/helm/charts/templates/csi-node.yaml +++ b/deploy/helm/charts/templates/csi-node.yaml @@ -22,6 +22,7 @@ spec: priorityClassName: {{ template "jiva.csiNode.priorityClassName" . }} serviceAccountName: {{ .Values.serviceAccount.csiNode.name }} hostNetwork: true + hostPID: {{ .Values.csiNode.hostPID }} containers: - name: {{ .Values.csiNode.driverRegistrar.name }} image: "{{ .Values.csiNode.driverRegistrar.image.registry }}{{ .Values.csiNode.driverRegistrar.image.repository }}:{{ .Values.csiNode.driverRegistrar.image.tag }}" diff --git a/deploy/helm/charts/values.yaml b/deploy/helm/charts/values.yaml index de12330..3df90bc 100644 --- a/deploy/helm/charts/values.yaml +++ b/deploy/helm/charts/values.yaml @@ -127,6 +127,12 @@ csiNode: name: jiva-csi-node-critical value: 900001000 componentName: "openebs-jiva-csi-node" + hostPID: false + # customIscsiadmConfig is used to override the default iscsiadm config + # customIscsiadmConfig: | + # #!/bin/sh + # iscsid_pid=$(pgrep iscsid) + # nsenter --mount="/proc/${iscsid_pid}/ns/mnt" --net="/proc/${iscsid_pid}/ns/net" -- /usr/local/sbin/iscsiadm "$@" logLevel: "5" driverRegistrar: name: "csi-node-driver-registrar"