File tree Expand file tree Collapse file tree 3 files changed +57
-10
lines changed
charts/latest/csi-driver-nfs Expand file tree Collapse file tree 3 files changed +57
-10
lines changed Original file line number Diff line number Diff line change 61
61
- mountPath : /csi
62
62
name : socket-dir
63
63
resources : {{- toYaml .Values.controller.resources.csiProvisioner | nindent 12 }}
64
+ {{- with .Values.controller.containerSecurityContext.csiProvisioner }}
65
+ securityContext :
66
+ {{- toYaml . | nindent 12 }}
67
+ {{- end }}
64
68
- name : liveness-probe
65
69
image : " {{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}"
66
70
args :
@@ -73,13 +77,12 @@ spec:
73
77
- name : socket-dir
74
78
mountPath : /csi
75
79
resources : {{- toYaml .Values.controller.resources.livenessProbe | nindent 12 }}
80
+ {{- with .Values.controller.containerSecurityContext.livenessProbe }}
81
+ securityContext :
82
+ {{- toYaml . | nindent 12 }}
83
+ {{- end }}
76
84
- name : nfs
77
85
image : " {{ .Values.image.nfs.repository }}:{{ .Values.image.nfs.tag }}"
78
- securityContext :
79
- privileged : true
80
- capabilities :
81
- add : ["SYS_ADMIN"]
82
- allowPrivilegeEscalation : true
83
86
imagePullPolicy : {{ .Values.image.nfs.pullPolicy }}
84
87
args :
85
88
- " --v={{ .Values.controller.logLevel }}"
@@ -114,10 +117,17 @@ spec:
114
117
- mountPath : /csi
115
118
name : socket-dir
116
119
resources : {{- toYaml .Values.controller.resources.nfs | nindent 12 }}
120
+ {{- with .Values.controller.containerSecurityContext.nfs }}
121
+ securityContext :
122
+ {{- toYaml . | nindent 12 }}
123
+ {{- end }}
117
124
volumes :
118
125
- name : pods-mount-dir
119
126
hostPath :
120
127
path : {{ .Values.kubeletDir }}/pods
121
128
type : Directory
122
129
- name : socket-dir
123
130
emptyDir : {}
131
+ {{- with .Values.controller.securityContext }}
132
+ securityContext : {{- toYaml . | nindent 8 }}
133
+ {{- end }}
Original file line number Diff line number Diff line change 51
51
- name : socket-dir
52
52
mountPath : /csi
53
53
resources : {{- toYaml .Values.node.resources.livenessProbe | nindent 12 }}
54
+ {{- with .Values.node.containerSecurityContext.livenessProbe }}
55
+ securityContext :
56
+ {{- toYaml . | nindent 12 }}
57
+ {{- end }}
54
58
- name : node-driver-registrar
55
59
image : " {{ .Values.image.nodeDriverRegistrar.repository }}:{{ .Values.image.nodeDriverRegistrar.tag }}"
56
60
livenessProbe :
@@ -79,12 +83,11 @@ spec:
79
83
- name : registration-dir
80
84
mountPath : /registration
81
85
resources : {{- toYaml .Values.node.resources.nodeDriverRegistrar | nindent 12 }}
86
+ {{- with .Values.node.containerSecurityContext.nodeDriverRegistrar }}
87
+ securityContext :
88
+ {{- toYaml . | nindent 12 }}
89
+ {{- end }}
82
90
- name : nfs
83
- securityContext :
84
- privileged : true
85
- capabilities :
86
- add : ["SYS_ADMIN"]
87
- allowPrivilegeEscalation : true
88
91
image : " {{ .Values.image.nfs.repository }}:{{ .Values.image.nfs.tag }}"
89
92
args :
90
93
- " --v={{ .Values.node.logLevel }}"
@@ -119,6 +122,10 @@ spec:
119
122
mountPath : {{ .Values.kubeletDir }}/pods
120
123
mountPropagation : " Bidirectional"
121
124
resources : {{- toYaml .Values.node.resources.nfs | nindent 12 }}
125
+ {{- with .Values.node.containerSecurityContext.nfs }}
126
+ securityContext :
127
+ {{- toYaml . | nindent 12 }}
128
+ {{- end }}
122
129
volumes :
123
130
- name : socket-dir
124
131
hostPath :
@@ -132,3 +139,6 @@ spec:
132
139
path : {{ .Values.kubeletDir }}/plugins_registry
133
140
type : Directory
134
141
name : registration-dir
142
+ {{- with .Values.node.securityContext }}
143
+ securityContext : {{- toYaml . | nindent 8 }}
144
+ {{- end }}
Original file line number Diff line number Diff line change @@ -77,6 +77,20 @@ controller:
77
77
requests :
78
78
cpu : 10m
79
79
memory : 20Mi
80
+ containerSecurityContext :
81
+ csiProvisioner :
82
+ readOnlyRootFilesystem : true
83
+ livenessProbe :
84
+ readOnlyRootFilesystem : true
85
+ nfs :
86
+ privileged : true
87
+ capabilities :
88
+ add : ["SYS_ADMIN"]
89
+ allowPrivilegeEscalation : true
90
+ # # Security context give the opportunity to run container as nonroot by setting a securityContext
91
+ # # by example :
92
+ # # securityContext: { runAsUser: 1001 }
93
+ securityContext : {}
80
94
81
95
node :
82
96
name : csi-nfs-node
@@ -108,6 +122,19 @@ node:
108
122
requests :
109
123
cpu : 10m
110
124
memory : 20Mi
125
+ containerSecurityContext :
126
+ livenessProbe :
127
+ readOnlyRootFilesystem : true
128
+ nodeDriverRegistrar : {}
129
+ nfs :
130
+ privileged : true
131
+ capabilities :
132
+ add : ["SYS_ADMIN"]
133
+ allowPrivilegeEscalation : true
134
+ # # Security context give the opportunity to run container as nonroot by setting a securityContext
135
+ # # by example :
136
+ # # securityContext: { runAsUser: 1001 }
137
+ securityContext : {}
111
138
112
139
# # Reference to one or more secrets to be used when pulling images
113
140
# # ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
You can’t perform that action at this time.
0 commit comments