Is there any way I can run container in k8s as root user or other user. Like in docker
docker run --user <user> <image>
Is there any yaml configuration for running with
As described in the kubernetes docs, you can set the security context for the container and set the runAsUser
property as such:
containers:
- name: ...
image: ...
securityContext:
runAsUser: 0
This will make the container execute internally as the root user.