Skip to content

Commit

Permalink
Adds custom iSCSIadm ConfigMap and HostPID options
Browse files Browse the repository at this point in the history
Tackles issue openebs-archive#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 <leo.sunmo@gmail.com>
  • Loading branch information
leosunmo committed Dec 28, 2023
1 parent 385a2fb commit 5877ba6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deploy/helm/charts/templates/csi-iscsiadm-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"
Expand All @@ -16,3 +19,4 @@ data:
else
chroot /host iscsiadm "$@"
fi
{{- end }}
1 change: 1 addition & 0 deletions deploy/helm/charts/templates/csi-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
6 changes: 6 additions & 0 deletions deploy/helm/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5877ba6

Please sign in to comment.