How to set global user ID for Kubernetes?

4/19/2020

OpenShift is able to run Docker containers via Kubernetes with a random user ID from a specific range:

When you deploy an application it will appear that it is running as a random user ID, overriding what user ID the image itself may specify that it should run as.

See: https://cookbook.openshift.org/users-and-role-based-access-control/why-do-my-applications-run-as-a-random-user-id.html

Now I’d like to test locally (eg using Minikube) with this or similar behaviour. I.e. Setting the user ID overriding the one specified in the dockerfile and without explicitly setting a security context in the Kubernetes YAML used for deployment.

Can this be done, and if so, how?

-- Arjan Tijms
authorization
kubernetes
kubernetes-pod
minikube
security

0 Answers