PID namespace
The namespace that decides which other processes a process can see and how they are numbered.
In more detail
Inside a new PID namespace the first process becomes PID 1 and cannot see processes outside. Running a container with --pid=host puts it in the host PID namespace instead, so ps shows every process on the machine. Monitoring agents are run this way on purpose; ordinary services should not be.
Example
docker run --rm --pid=host alpine:3.20 ps -o commRelated terms
- namespace (Linux) — A Linux kernel feature that controls what a process can see, such as which other processes, network or host name.
- process ID — The number the kernel gives each running process so it can be told apart from all the others.
- init process — The first process started on a system or in a container, with process ID 1 and special duties.
Taught in
- Debugging Applications In Kubernetes — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Pod Security Admission: Created, Never Started — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Kubernetes Pod Security Standards: Baseline & Restricted — Cloud Security & DevSecOps Engineering
- Namespaces And Cgroups: Isolation And Limits — Docker Architecture & Production Containers
- Commands, Logs, Exec And Exit Codes — Docker Architecture & Production Containers
- What Outlives The Fix: Persistence And Privilege Escalation — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep