shy-dog-84302
09/14/2022, 7:04 PMconfigure-sysctl
initcontainer pod.
I see running sysctl command requires root access but the container constraints does not allow that. Attached is my StatefulSet that results in this error.
How can I fix this?
Event : elasticsearch-master StatefulSet elasticsearch-master datahub create Pod elasticsearch-master-0 in StatefulSet elasticsearch-master failed error: admission webhook "<http://pod-security-webhook.kubernetes.io|pod-security-webhook.kubernetes.io>" denied the request: pods "elasticsearch-master-0" is forbidden: violates PodSecurity "restricted:latest": privileged (container "configure-sysctl" must not set securityContext.privileged=true), allowPrivilegeEscalation != false (container "configure-sysctl" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "configure-sysctl" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "configure-sysctl" must set securityContext.runAsNonRoot=true), runAsUser=0 (container "configure-sysctl" must not set runAsUser=0), seccompProfile (pod or container "configure-sysctl" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost") FailedCreate
orange-night-91387
09/14/2022, 8:49 PMshy-dog-84302
09/15/2022, 1:45 AMshy-dog-84302
09/15/2022, 1:55 AMshy-dog-84302
09/15/2022, 3:19 AMshy-dog-84302
09/15/2022, 10:32 AMbumpy-needle-3184
09/15/2022, 11:07 AMshy-dog-84302
09/15/2022, 11:11 AMbumpy-needle-3184
09/15/2022, 11:12 AMsysctlInitContainer:
enabled: false
shy-dog-84302
09/15/2022, 11:14 AMbumpy-needle-3184
09/15/2022, 11:15 AMshy-dog-84302
09/15/2022, 11:16 AMrunAsUser: 0
but obviously that couldn’t run sysctl eitherbumpy-needle-3184
09/15/2022, 11:17 AMsecurityContext:
allowPrivilegeEscalation: true
shy-dog-84302
09/15/2022, 11:19 AMshy-dog-84302
09/15/2022, 5:11 PMwhite-appointment-14217
08/31/2023, 1:09 PMshy-dog-84302
09/05/2023, 9:25 AM