runAsNonRoot Failures
After you add runAsNonRoot: true to a Pod, its container stays in CreateContainerConfigError with "container has runAsNonRoot and image will run as root". What fixes it while keeping the setting?
runAsNonRoot: true
CreateContainerConfigError
Choose one answer
Add the SETUID capability so the entrypoint can drop to a non-root user.
SETUID
Set runAsUser to a non-zero UID (for example 10001) in the securityContext, or build the image with a numeric non-root USER.
runAsUser
10001
USER
Set readOnlyRootFilesystem: true, which implies a non-root user.
readOnlyRootFilesystem: true
Add allowPrivilegeEscalation: true so the container can switch users itself.
allowPrivilegeEscalation: true