k8wiz
Kubernetes
Easy
Security

Which Pod spec setting asks the kubelet to run a Pod in its own Linux user namespace?

Select your answer:

Show answer and explanation

Answer: spec.hostUsers: false

Explanation

Setting spec.hostUsers to false opts the Pod into a user namespace, so root inside the container maps to an unprivileged ID range on the host. runAsNonRoot only makes the kubelet refuse to start containers that would run as UID 0, and it does not create a user namespace.

Read more about Kubernetes