Make csi driver configurable to be able to run multiple instances (#115)

Co-authored-by: Marco Franssen <[email protected]>
This commit is contained in:
kfox1111
2023-03-13 14:12:37 +01:00
committed by GitHub
co-authored by Marco Franssen
parent b198bc7e39
commit f3a81ad78d
4 changed files with 14 additions and 5 deletions
@@ -14,6 +14,7 @@ A Helm chart to install the SPIFFE CSI driver.
| Key | Type | Default | Description | | Key | Type | Default | Description |
|-----|------|---------|-------------| |-----|------|---------|-------------|
| fullnameOverride | string | `""` | | | fullnameOverride | string | `""` | |
| healthChecks.port | int | `9809` | |
| image.pullPolicy | string | `"IfNotPresent"` | | | image.pullPolicy | string | `"IfNotPresent"` | |
| image.registry | string | `"ghcr.io"` | | | image.registry | string | `"ghcr.io"` | |
| image.repository | string | `"spiffe/spiffe-csi-driver"` | | | image.repository | string | `"spiffe/spiffe-csi-driver"` | |
@@ -27,6 +28,7 @@ A Helm chart to install the SPIFFE CSI driver.
| nodeDriverRegistrar.image.version | string | `"v2.6.2"` | | | nodeDriverRegistrar.image.version | string | `"v2.6.2"` | |
| nodeDriverRegistrar.resources | object | `{}` | | | nodeDriverRegistrar.resources | object | `{}` | |
| nodeSelector | object | `{}` | | | nodeSelector | object | `{}` | |
| pluginName | string | `"csi.spiffe.io"` | Set the csi driver name deployed to Kubernetes. |
| podAnnotations | object | `{}` | | | podAnnotations | object | `{}` | |
| podSecurityContext | object | `{}` | | | podSecurityContext | object | `{}` | |
| priorityClassName | string | `""` | Priority class assigned to daemonset pods | | priorityClassName | string | `""` | Priority class assigned to daemonset pods |
@@ -35,6 +35,7 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
args: [ args: [
"-workload-api-socket-dir", "/spire-agent-socket", "-workload-api-socket-dir", "/spire-agent-socket",
"-plugin-name", "{{ .Values.pluginName }}",
"-csi-socket-path", "/spiffe-csi/csi.sock", "-csi-socket-path", "/spiffe-csi/csi.sock",
] ]
env: env:
@@ -74,8 +75,8 @@ spec:
imagePullPolicy: {{ .Values.nodeDriverRegistrar.image.pullPolicy }} imagePullPolicy: {{ .Values.nodeDriverRegistrar.image.pullPolicy }}
args: [ args: [
"-csi-address", "/spiffe-csi/csi.sock", "-csi-address", "/spiffe-csi/csi.sock",
"-kubelet-registration-path", "/var/lib/kubelet/plugins/csi.spiffe.io/csi.sock", "-kubelet-registration-path", "/var/lib/kubelet/plugins/{{ .Values.pluginName }}/csi.sock",
"-health-port", "9809" "-health-port", "{{ .Values.healthChecks.port }}"
] ]
volumeMounts: volumeMounts:
# The registrar needs access to the SPIFFE CSI driver socket # The registrar needs access to the SPIFFE CSI driver socket
@@ -86,7 +87,7 @@ spec:
- name: kubelet-plugin-registration-dir - name: kubelet-plugin-registration-dir
mountPath: /registration mountPath: /registration
ports: ports:
- containerPort: 9809 - containerPort: {{ .Values.healthChecks.port }}
name: healthz name: healthz
livenessProbe: livenessProbe:
httpGet: httpGet:
@@ -104,7 +105,7 @@ spec:
# This volume is where the socket for kubelet->driver communication lives # This volume is where the socket for kubelet->driver communication lives
- name: spiffe-csi-socket-dir - name: spiffe-csi-socket-dir
hostPath: hostPath:
path: /var/lib/kubelet/plugins/csi.spiffe.io path: /var/lib/kubelet/plugins/{{ .Values.pluginName }}
type: DirectoryOrCreate type: DirectoryOrCreate
# This volume is where the SPIFFE CSI driver mounts volumes # This volume is where the SPIFFE CSI driver mounts volumes
- name: mountpoint-dir - name: mountpoint-dir
@@ -1,7 +1,7 @@
apiVersion: storage.k8s.io/v1 apiVersion: storage.k8s.io/v1
kind: CSIDriver kind: CSIDriver
metadata: metadata:
name: "csi.spiffe.io" name: {{ .Values.pluginName | quote }}
spec: spec:
# Only ephemeral, inline volumes are supported. There is no need for a # Only ephemeral, inline volumes are supported. There is no need for a
# controller to provision and attach volumes. # controller to provision and attach volumes.
@@ -1,3 +1,6 @@
# -- Set the csi driver name deployed to Kubernetes.
pluginName: csi.spiffe.io
image: image:
registry: ghcr.io registry: ghcr.io
repository: spiffe/spiffe-csi-driver repository: spiffe/spiffe-csi-driver
@@ -15,6 +18,9 @@ resources: {}
# cpu: 100m # cpu: 100m
# memory: 64Mi # memory: 64Mi
healthChecks:
port: 9809
imagePullSecrets: [] imagePullSecrets: []
nameOverride: "" nameOverride: ""
namespaceOverride: "" namespaceOverride: ""