From 88a3968f5a9b5b435fbc7a9e19d67a7f2fcd2099 Mon Sep 17 00:00:00 2001 From: 0xfourzerofour <0x@404.sh> Date: Sun, 1 Jun 2025 21:47:53 -0400 Subject: [PATCH 1/2] feat(volume): and a mounting option --- helm-chart/csi-driver/templates/daemonset.yaml | 16 +++++++++++----- helm-chart/csi-driver/values.yaml | 7 +++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/helm-chart/csi-driver/templates/daemonset.yaml b/helm-chart/csi-driver/templates/daemonset.yaml index c8aacb5e..81f335ff 100644 --- a/helm-chart/csi-driver/templates/daemonset.yaml +++ b/helm-chart/csi-driver/templates/daemonset.yaml @@ -27,11 +27,14 @@ spec: - name: ADDRESS value: /csi/csi.sock - name: DRIVER_REG_SOCK_PATH - value: /var/lib/kubelet/plugins/linodebs.csi.linode.com/csi.sock + value: {{ .Values.kubeletPath | default "/var/lib/kubelet" }}/plugins/linodebs.csi.linode.com/csi.sock - name: KUBE_NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName + {{- with .Values.csiNodeDriverRegistrar.env }} + {{- toYaml . | nindent 8 }} + {{- end }} image: {{ .Values.csiNodeDriverRegistrar.image}}:{{ .Values.csiNodeDriverRegistrar.tag}} name: csi-node-driver-registrar securityContext: @@ -42,8 +45,11 @@ spec: volumeMounts: - mountPath: /csi name: plugin-dir - - mountPath: /registration + - mountPath: {{ .Values.kubeletPath | default "/var/lib/kubelet" }}/plugins_registry name: registration-dir + {{- with .Values.csiNodeDriverRegistrar.volumeMounts }} + {{- toYaml . | nindent 8 }} + {{- end }} - args: - --v=2 env: @@ -100,15 +106,15 @@ spec: operator: Exists volumes: - hostPath: - path: /var/lib/kubelet/plugins_registry/ + path: {{ .Values.kubeletPath | default "/var/lib/kubelet" }}/plugins_registry/ type: DirectoryOrCreate name: registration-dir - hostPath: - path: /var/lib/kubelet + path: {{ .Values.kubeletPath | default "/var/lib/kubelet" }} type: Directory name: kubelet-dir - hostPath: - path: /var/lib/kubelet/plugins/linodebs.csi.linode.com + path: {{ .Values.kubeletPath | default "/var/lib/kubelet" }}/plugins/linodebs.csi.linode.com type: DirectoryOrCreate name: plugin-dir - hostPath: diff --git a/helm-chart/csi-driver/values.yaml b/helm-chart/csi-driver/values.yaml index af4ccdfe..46620b01 100644 --- a/helm-chart/csi-driver/values.yaml +++ b/helm-chart/csi-driver/values.yaml @@ -23,6 +23,9 @@ volumeLabelPrefix: "" # Default namespace is "kube-system" but it can be set to another namespace namespace: kube-system +# Add a kubelet path variable to be used across containers for alternate k8s distros (e.g K0s, K3s) +kubeletPath: "/var/lib/kubelet" + # Set these values if your APIToken and region are already present in a k8s secret. # secretRef: # name: "linode" @@ -91,6 +94,10 @@ kubectl: csiNodeDriverRegistrar: image: registry.k8s.io/sig-storage/csi-node-driver-registrar tag: v2.12.0 + # Additional environment variables for the node driver registrar container + env: [] + # Additional volume mounts for the node driver registrar container + volumeMounts: [] controller: nodeSelector: {} From f18d7ebe2b0a744459a624603c1342c5d83df383 Mon Sep 17 00:00:00 2001 From: 0xfourzerofour <0x@404.sh> Date: Sun, 1 Jun 2025 22:06:26 -0400 Subject: [PATCH 2/2] feat(volume): add back --- helm-chart/csi-driver/templates/daemonset.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm-chart/csi-driver/templates/daemonset.yaml b/helm-chart/csi-driver/templates/daemonset.yaml index 81f335ff..0f2d01b7 100644 --- a/helm-chart/csi-driver/templates/daemonset.yaml +++ b/helm-chart/csi-driver/templates/daemonset.yaml @@ -45,7 +45,7 @@ spec: volumeMounts: - mountPath: /csi name: plugin-dir - - mountPath: {{ .Values.kubeletPath | default "/var/lib/kubelet" }}/plugins_registry + - mountPath: /registration name: registration-dir {{- with .Values.csiNodeDriverRegistrar.volumeMounts }} {{- toYaml . | nindent 8 }}