Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: container has runAsNonRoot and image will run as root #31

Open
PieperCH opened this issue Aug 13, 2020 · 1 comment
Open

Error: container has runAsNonRoot and image will run as root #31

PieperCH opened this issue Aug 13, 2020 · 1 comment

Comments

@PieperCH
Copy link

Hi all,

deploying the hello-k8s simple demo app to our PKS kubernetes cluster shows this error in

C:\kubectl describe po demo-b579d8cb6-25lvv

Warning Failed 5s (x3 over 37s) kubelet, ab58d759-e5ad-4f5c-8a84-8039c0181301 Error: container has runAsNonRoot and image will run as root

What is wrong here in the image?

Regards,
Christian

@bitfield
Copy link
Contributor

Nothing's wrong as such, but Kubernetes is saying you have a PodSecurityContext that specifies the container must not run as root, and the default in Docker containers if you don't specify a user is to run as root. I don't think we specify runAsNonRoot anywhere in the k8s manifests, so this may be a local config issue with your cluster or provider. (Personally, I think defaulting to runAsNonRoot is an awfully good idea, so I wouldn't change it—but just be aware there will be a similar issue running almost any Docker image unless you specify a non-root user for it.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants