Skip to content

Commit 8bf95c8

Browse files
1602077jack munday
andauthored
deploy(helm): configure seccomp profile for node & controller plugin (#141)
* deploy: add Runtime default seccomp profile * chore: yamlfmt to fix indentations * chore: docstring on pod security contexts * docs: update chart readme with new values --------- Co-authored-by: jack munday <[email protected]>
1 parent d46fe5b commit 8bf95c8

File tree

4 files changed

+40
-20
lines changed

4 files changed

+40
-20
lines changed

deployments/helm/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,13 @@ Alternatively, a YAML file that specifies the values of the parameters can be pr
7373
| `nodeplugin.registrar.image.pullPolicy` | Pull policy for csi-node-driver-registrar image. |
7474
| `nodeplugin.registrar.image.resources` | Resource constraints for the `registrar` container. |
7575
| `nodeplugin.updateStrategySpec` | DaemonSet update strategy. |
76+
| `nodeplugin.podSecurityContext` | Pod-level security context for nodeplugin DaemonSet. |
7677
| `nodeplugin.priorityClassName` | Pod priority class name of the nodeplugin DaemonSet. |
7778
| `nodeplugin.nodeSelector` | Pod node selector of the nodeplugin DaemonSet. |
7879
| `nodeplugin.tolerations` | Pod tolerations of the nodeplugin DaemonSet. |
7980
| `nodeplugin.affinity` | Pod node affinity of the nodeplugin DaemonSet. |
8081
| `controllerplugin.name` | Component name for controller plugin component. Used as `component` label value and to generate Deployment name. |
82+
| `controllerplugin.podSecurityContext` | Pod-level security context for controllerplugin deployment. |
8183
| `controllerplugin.plugin.image.repository` | Container image repository for CVMFS CSI controller plugin. |
8284
| `controllerplugin.plugin.image.tag` | Container image tag for CVMFS CSI controller plugin. |
8385
| `controllerplugin.plugin.image.pullPolicy` | Pull policy for CVMFS CSI controller plugin image. |

deployments/helm/cvmfs-csi/templates/controllerplugin-deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ spec:
1515
labels:
1616
{{- include "cvmfs-csi.controllerplugin.labels" . | nindent 8 }}
1717
spec:
18+
{{- with .Values.controllerplugin.podSecurityContext }}
19+
securityContext: {{ toYaml . | nindent 8 }}
20+
{{- end }}
1821
serviceAccount: {{ include "cvmfs-csi.serviceAccountName.controllerplugin" . }}
1922
containers:
2023
- name: provisioner

deployments/helm/cvmfs-csi/templates/nodeplugin-daemonset.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ spec:
1616
spec:
1717
# hostPID is required for autofs to work.
1818
hostPID: {{ .Values.nodeplugin.hostPID }}
19+
{{- with .Values.nodeplugin.podSecurityContext }}
20+
securityContext: {{ toYaml . | nindent 8 }}
21+
{{- end }}
1922
{{- if .Values.nodeplugin.serviceAccount.use }}
2023
serviceAccount: {{ include "cvmfs-csi.serviceAccountName.nodeplugin" . }}
2124
{{- end }}

deployments/helm/cvmfs-csi/values.yaml

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ nodeplugin:
5959

6060
# Extra volumes to be appended to nodeplugin's Pod.spec.volumes.
6161
extraVolumes:
62-
- name: etc-cvmfs-default-conf
63-
configMap:
64-
name: cvmfs-csi-default-local
65-
- name: etc-cvmfs-config-d
66-
configMap:
67-
name: cvmfs-csi-config-d
62+
- name: etc-cvmfs-default-conf
63+
configMap:
64+
name: cvmfs-csi-default-local
65+
- name: etc-cvmfs-config-d
66+
configMap:
67+
name: cvmfs-csi-config-d
6868

6969
# CVMFS CSI image and container resources specs.
7070
plugin:
@@ -84,11 +84,11 @@ nodeplugin:
8484
# Extra volume mounts to append to nodeplugin's
8585
# Pod.spec.containers[name="nodeplugin"].volumeMounts.
8686
extraVolumeMounts:
87-
- name: etc-cvmfs-default-conf
88-
mountPath: /etc/cvmfs/default.local
89-
subPath: default.local
90-
- name: etc-cvmfs-config-d
91-
mountPath: /etc/cvmfs/config.d
87+
- name: etc-cvmfs-default-conf
88+
mountPath: /etc/cvmfs/default.local
89+
subPath: default.local
90+
- name: etc-cvmfs-config-d
91+
mountPath: /etc/cvmfs/config.d
9292

9393
# automount-reconciler image and container resources specs.
9494
automountReconciler:
@@ -100,11 +100,11 @@ nodeplugin:
100100
# Extra volume mounts to append to nodeplugin's
101101
# Pod.spec.containers[name="automountReconciler"].volumeMounts.
102102
extraVolumeMounts:
103-
- name: etc-cvmfs-default-conf
104-
mountPath: /etc/cvmfs/default.local
105-
subPath: default.local
106-
- name: etc-cvmfs-config-d
107-
mountPath: /etc/cvmfs/config.d
103+
- name: etc-cvmfs-default-conf
104+
mountPath: /etc/cvmfs/default.local
105+
subPath: default.local
106+
- name: etc-cvmfs-config-d
107+
mountPath: /etc/cvmfs/config.d
108108

109109
# automount-runner image and container resources specs.
110110
singlemount:
@@ -133,6 +133,11 @@ nodeplugin:
133133
# too in order to refresh the mounts.
134134
type: OnDelete
135135

136+
# Pod-level security context for nodeplugin daemonset.
137+
podSecurityContext:
138+
seccompProfile:
139+
type: RuntimeDefault
140+
136141
# Pod priority class name.
137142
priorityClassName: system-node-critical
138143

@@ -161,16 +166,18 @@ nodeplugin:
161166
serviceAccountName: cvmfs-nodeplugin
162167

163168
# Whether to create ServiceAccount in the CVMFS CSI namespace.
164-
# If not, and `use` is set to true, it is expected the ServiceAccount is already present.
169+
# If not, and `use` is set to true, it is expected the ServiceAccount is
170+
# already present.
165171
create: false
166172

167173
# Whether to use this ServiceAccount in Node plugin DaemonSet.
168174
use: false
169175

170176
# CSI Controller plugin Deployment configuration.
171-
# CVMFS CSI supports volume provisioning, however the provisioned volumes only fulfill the role
172-
# of a reference to CVMFS repositories used inside the CO (e.g. Kubernetes), and are not modifying
173-
# the CVMFS store in any way.
177+
#
178+
# CVMFS CSI supports volume provisioning, however the provisioned volumes only
179+
# fulfil the role of a reference to CVMFS repositories used inside the CO
180+
# (e.g. Kubernetes), and are not modifying the CVMFS store in any way.
174181
controllerplugin:
175182

176183
# Component name. Used as `component` label value
@@ -203,6 +210,11 @@ controllerplugin:
203210
deploymentStrategySpec:
204211
type: RollingUpdate
205212

213+
# Pod-level security context for controllerplugin deployment.
214+
podSecurityContext:
215+
seccompProfile:
216+
type: RuntimeDefault
217+
206218
# Pod priority class name.
207219
priorityClassName: ""
208220

0 commit comments

Comments
 (0)