CertGrid CertGrid
Hands-on Lab·Certified Kubernetes Administrator

securityContext and Non-Root Containers

Containers run as root unless you say otherwise. Set a non-root user, drop every capability, make the root filesystem read-only, and then find out which of those settings produced the error when a write fails.

Configuration and Secrets Guide 37 of 103 Intermediate

Written against the versions above. UID values are arbitrary choices. The enforcement behaviour is not.

Any cluster does. Run against the four-node lab.
Server NameIP AddressOSRolesCPURAMHDD
CKA1001192.168.0.175Ubuntu 26.04 LTSControl Plane Node2 Core4 GB50 GB
CKA1001-NODE01192.168.0.176Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE02192.168.0.177Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE03192.168.0.178Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB

Before you start

  1. The default is root, and that is the problem

  2. Confirm who it is

  3. Which setting actually blocked the write?

  4. Clean up

Official sources