From 9ccbd3c67f0e55117842720758d7165690ed811e Mon Sep 17 00:00:00 2001 From: kfox1111 Date: Wed, 15 Mar 2023 02:25:06 -0700 Subject: [PATCH] Make kubelet path configurable (#123) --- charts/spire/charts/spiffe-csi-driver/README.md | 1 + .../charts/spiffe-csi-driver/templates/daemonset.yaml | 10 +++++----- charts/spire/charts/spiffe-csi-driver/values.yaml | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/charts/spire/charts/spiffe-csi-driver/README.md b/charts/spire/charts/spiffe-csi-driver/README.md index ad6e736..ee8e044 100644 --- a/charts/spire/charts/spiffe-csi-driver/README.md +++ b/charts/spire/charts/spiffe-csi-driver/README.md @@ -21,6 +21,7 @@ A Helm chart to install the SPIFFE CSI driver. | image.repository | string | `"spiffe/spiffe-csi-driver"` | | | image.version | string | `""` | | | imagePullSecrets | list | `[]` | | +| kubeletPath | string | `"/var/lib/kubelet"` | | | nameOverride | string | `""` | | | namespaceOverride | string | `""` | | | nodeDriverRegistrar.image.pullPolicy | string | `"IfNotPresent"` | | diff --git a/charts/spire/charts/spiffe-csi-driver/templates/daemonset.yaml b/charts/spire/charts/spiffe-csi-driver/templates/daemonset.yaml index 0aba8c9..59d1239 100644 --- a/charts/spire/charts/spiffe-csi-driver/templates/daemonset.yaml +++ b/charts/spire/charts/spiffe-csi-driver/templates/daemonset.yaml @@ -56,7 +56,7 @@ spec: - mountPath: /spiffe-csi name: spiffe-csi-socket-dir # The volume containing mount points for containers. - - mountPath: /var/lib/kubelet/pods + - mountPath: {{ .Values.kubeletPath }}/pods mountPropagation: Bidirectional name: mountpoint-dir securityContext: @@ -75,7 +75,7 @@ spec: imagePullPolicy: {{ .Values.nodeDriverRegistrar.image.pullPolicy }} args: [ "-csi-address", "/spiffe-csi/csi.sock", - "-kubelet-registration-path", "/var/lib/kubelet/plugins/{{ .Values.pluginName }}/csi.sock", + "-kubelet-registration-path", "{{ .Values.kubeletPath }}/plugins/{{ .Values.pluginName }}/csi.sock", "-health-port", "{{ .Values.healthChecks.port }}" ] volumeMounts: @@ -105,16 +105,16 @@ spec: # This volume is where the socket for kubelet->driver communication lives - name: spiffe-csi-socket-dir hostPath: - path: /var/lib/kubelet/plugins/{{ .Values.pluginName }} + path: {{ .Values.kubeletPath }}/plugins/{{ .Values.pluginName }} type: DirectoryOrCreate # This volume is where the SPIFFE CSI driver mounts volumes - name: mountpoint-dir hostPath: - path: /var/lib/kubelet/pods + path: {{ .Values.kubeletPath }}/pods type: Directory # This volume is where the node-driver-registrar registers the plugin # with kubelet - name: kubelet-plugin-registration-dir hostPath: - path: /var/lib/kubelet/plugins_registry + path: {{ .Values.kubeletPath }}/plugins_registry type: Directory diff --git a/charts/spire/charts/spiffe-csi-driver/values.yaml b/charts/spire/charts/spiffe-csi-driver/values.yaml index 62bf062..b1e9d93 100644 --- a/charts/spire/charts/spiffe-csi-driver/values.yaml +++ b/charts/spire/charts/spiffe-csi-driver/values.yaml @@ -71,5 +71,7 @@ nodeDriverRegistrar: agentSocketPath: /run/spire/agent-sockets/spire-agent.sock +kubeletPath: /var/lib/kubelet + # -- Priority class assigned to daemonset pods priorityClassName: ""