Skip to content

Commit 2999e7e

Browse files
authored
Merge pull request #422 from farodin91/securityContext
feat: add readOnlyRootFilesystem if possible
2 parents cd50d48 + 18432fa commit 2999e7e

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed
45 Bytes
Binary file not shown.

charts/latest/csi-driver-nfs/templates/csi-nfs-controller.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ spec:
6161
- mountPath: /csi
6262
name: socket-dir
6363
resources: {{- toYaml .Values.controller.resources.csiProvisioner | nindent 12 }}
64+
securityContext:
65+
readOnlyRootFilesystem: true
6466
- name: liveness-probe
6567
image: "{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}"
6668
args:
@@ -73,13 +75,16 @@ spec:
7375
- name: socket-dir
7476
mountPath: /csi
7577
resources: {{- toYaml .Values.controller.resources.livenessProbe | nindent 12 }}
78+
securityContext:
79+
readOnlyRootFilesystem: true
7680
- name: nfs
7781
image: "{{ .Values.image.nfs.repository }}:{{ .Values.image.nfs.tag }}"
7882
securityContext:
7983
privileged: true
8084
capabilities:
8185
add: ["SYS_ADMIN"]
8286
allowPrivilegeEscalation: true
87+
readOnlyRootFilesystem: true
8388
imagePullPolicy: {{ .Values.image.nfs.pullPolicy }}
8489
args:
8590
- "--v={{ .Values.controller.logLevel }}"
@@ -113,6 +118,8 @@ spec:
113118
mountPropagation: "Bidirectional"
114119
- mountPath: /csi
115120
name: socket-dir
121+
- mountPath: {{ .Values.controller.workingMountDir }}
122+
name: tmp-dir
116123
resources: {{- toYaml .Values.controller.resources.nfs | nindent 12 }}
117124
volumes:
118125
- name: pods-mount-dir
@@ -121,3 +128,5 @@ spec:
121128
type: Directory
122129
- name: socket-dir
123130
emptyDir: {}
131+
- name: tmp-dir
132+
emptyDir: {}

charts/latest/csi-driver-nfs/templates/csi-nfs-node.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ spec:
5151
- name: socket-dir
5252
mountPath: /csi
5353
resources: {{- toYaml .Values.node.resources.livenessProbe | nindent 12 }}
54+
securityContext:
55+
readOnlyRootFilesystem: true
5456
- name: node-driver-registrar
5557
image: "{{ .Values.image.nodeDriverRegistrar.repository }}:{{ .Values.image.nodeDriverRegistrar.tag }}"
5658
livenessProbe:
@@ -85,6 +87,7 @@ spec:
8587
capabilities:
8688
add: ["SYS_ADMIN"]
8789
allowPrivilegeEscalation: true
90+
readOnlyRootFilesystem: true
8891
image: "{{ .Values.image.nfs.repository }}:{{ .Values.image.nfs.tag }}"
8992
args :
9093
- "--v={{ .Values.node.logLevel }}"

0 commit comments

Comments
 (0)