@@ -141,6 +141,7 @@ func (s *csiNodeSyncer) ensureContainersSpec() []corev1.Container {
141
141
RunAsNonRoot : util .False (),
142
142
Privileged : util .True (), // Revisit if node server needs privileged permission
143
143
RunAsUser : func (uid int64 ) * int64 { return & uid }(0 ),
144
+ RunAsGroup : func (uid int64 ) * int64 { return & uid }(0 ),
144
145
}
145
146
fillSecurityContextCapabilities (
146
147
nodePlugin .SecurityContext ,
@@ -158,6 +159,7 @@ func (s *csiNodeSyncer) ensureContainersSpec() []corev1.Container {
158
159
registrar .SecurityContext = & corev1.SecurityContext {
159
160
RunAsNonRoot : util .False (),
160
161
RunAsUser : func (uid int64 ) * int64 { return & uid }(0 ),
162
+ RunAsGroup : func (uid int64 ) * int64 { return & uid }(0 ),
161
163
Privileged : util .False (),
162
164
}
163
165
fillSecurityContextCapabilities (registrar .SecurityContext )
@@ -174,6 +176,18 @@ func (s *csiNodeSyncer) ensureContainersSpec() []corev1.Container {
174
176
},
175
177
)
176
178
179
+ livenessProbe .SecurityContext = & corev1.SecurityContext {
180
+ RunAsNonRoot : util .True (),
181
+ RunAsUser : func (uid int64 ) * int64 { return & uid }(2121 ),
182
+ RunAsGroup : func (uid int64 ) * int64 { return & uid }(2121 ),
183
+ Privileged : util .False (),
184
+ // This is intended to help the container access privileged host paths like csi socket
185
+ SELinuxOptions : & corev1.SELinuxOptions {
186
+ Type : "spc_t" , // "Super Privileged Container" type.
187
+ Level : "s0" , // security level.
188
+ },
189
+ }
190
+
177
191
fillSecurityContextCapabilities (livenessProbe .SecurityContext )
178
192
livenessProbe .ImagePullPolicy = s .getCSINodeDriverRegistrarPullPolicy ()
179
193
livenessProbe .Resources = getSidecarResourceRequests (s .driver , constants .LivenessProbe )
@@ -221,6 +235,14 @@ func (s *csiNodeSyncer) getEnvFor(name string) []corev1.EnvVar {
221
235
Value : constants .COSCSIMounterSocketPath ,
222
236
},
223
237
envVarFromField ("KUBE_NODE_NAME" , "spec.nodeName" ),
238
+ {
239
+ Name : "IS_NODE_SERVER" ,
240
+ Value : "true" ,
241
+ },
242
+ {
243
+ Name : "SIDECAR_GROUP_ID" ,
244
+ Value : "2121" ,
245
+ },
224
246
}
225
247
226
248
case constants .CSINodeDriverRegistrar :
0 commit comments