Good afternoon.
So I have an RKE2 cluster with the security policy in place that does not allow root pods to run. I have a pod that has to run as root and have been trying to figure out how to allow my pod to deploy on this cluster without success.
So far I have tried to explicitly set the following:
securityContext:
runAsUser: 0
runAsGroup: 0
The pod still fails to be allowed to run on the environment. Is there a way to not totally disable the security policy and perhaps an an exception for a single namespace? Thank you.
PodSecurityPolicy is deprecated and will be completely removed in v1.25, you should start considering migrating to Pod Security Admission where "kube-system" namespace is explicitly exempted from PodSecurity.
Known limitations: Namespace policy update warnings
Follow this document for more information