Privileged Containers
What you'll learn: When privileged containers are necessary and the major security risks they introduce to your Kubernetes cluster.
What Is a Privileged Container?
A privileged container runs with nearly all the capabilities of the host machine—essentially running as root on the underlying node. When you set privileged: true in the container's security context, you're removing most of the isolation that containers normally provide.
Think of it like this: a normal container is a guest staying in a hotel room with locked doors and limited access. A privileged container is like giving that guest a master key and unrestricted access to every room, the maintenance areas, and the building's infrastructure.
When Privileged Mode Is Needed
Certain workloads require direct access to host devices or low-level system operations:
- Container runtimes (like Docker-in-Docker)
- Network plugins that configure host networking
- Storage drivers that need direct disk access
- Monitoring agents that inspect kernel-level metrics
- Device management for GPUs or specialized hardware
These use cases typically involve system administration tasks that normal containers cannot perform.
Security Risks
Privileged containers bypass most security boundaries:
- Full host access: Can read/write any file on the node
- Kernel manipulation: Can load kernel modules or change system settings
- Break container isolation: Can access other containers' data
- Node compromise: A breach in a privileged container = full node control
- Cluster-wide impact: Attackers could pivot to other nodes
This essentially negates the security benefits you've carefully built with non-root users, read-only filesystems, and privilege escalation controls.
Key Takeaway: Privileged containers grant nearly unrestricted host access and should only be used for infrastructure-level workloads that absolutely require it—never for regular application containers, as they represent a critical security risk to your entire cluster.