Do Kubernetes pods have their own Linux kernel? No, and here’s why
By Pranav T · · 2 min read
Short answer
No. Every container on a Kubernetes node shares the host’s single Linux kernel. Two kernel features make containers feel like separate machines: namespaces control what a container can see (processes, network, hostname, mounts, users), and cgroups control what it can use (CPU, memory, I/O). That is why containers start in milliseconds, and also why a kernel vulnerability can affect every container on the node.
Does every pod run its own kernel?
I used to think every Kubernetes pod had its own Linux kernel. While working one day I wondered: if I run 50 pods on a node, are there 50 kernels running?
The answer: no. There’s just one. Every container on a node shares the host’s Linux kernel. You can see it yourself: run uname -r inside any container and it prints the node’s kernel version.
What makes containers feel like separate machines?
Two kernel features. Namespaces control what a container can see:
- PID namespace: its own process IDs, so it sees itself as PID 1
- Network namespace: its own network stack, interfaces and ports
- UTS namespace: its own hostname
- Mount namespace: its own filesystem mount points
- User namespace: its own user and group IDs
cgroups (control groups) control what a container can use: CPU, memory and I/O limits. The resources.requests and resources.limits you set on a pod end up as cgroup settings on the node.
Containers in the same pod go one step further and share a network namespace, which is why they can reach each other on localhost.
Who sets this up?
The container runtime. When a pod starts, the kubelet asks the runtime (containerd, which uses runc underneath) to create the containers, and runc sets up the namespaces and cgroups. Each container gets an isolated view of the system, but they all run on the same kernel underneath.
Why does a shared kernel matter?
- Containers start in milliseconds, because there is no operating system to boot.
- They are far lighter than virtual machines: no guest kernel, no duplicated OS memory.
- A kernel vulnerability can affect every container on the node, because they all trust the same kernel.
| Container | Virtual machine | |
|---|---|---|
| Kernel | Shared with the host | Its own guest kernel |
| Start-up time | Milliseconds | Seconds to minutes |
| Isolation boundary | Namespaces and cgroups | Hypervisor |
| Overhead | Very low | Higher |
How do you get stronger isolation when you need it?
That shared-kernel risk is why sandboxed runtimes exist. gVisor puts a user-space kernel between the container and the host, so most system calls never reach the real kernel. Kata Containers runs each pod inside a lightweight virtual machine with its own kernel. Both plug into Kubernetes through a RuntimeClass, so you can use them only for untrusted workloads.
Frequently asked questions
- Do Docker containers have their own kernel?
- No. Docker containers, like Kubernetes containers, share the host’s kernel. Running uname -r inside a container shows the host’s kernel version.
- What is the difference between namespaces and cgroups?
- Namespaces limit what a process can see, such as process IDs, network and mounts. cgroups limit what it can use, such as CPU, memory and I/O.
- Are containers less secure than virtual machines?
- They have a thinner isolation boundary because they share one kernel, so a kernel exploit can reach every container on the node. Sandboxed runtimes such as gVisor or Kata Containers add a stronger boundary when needed.
More articles
- How Signify (ppt-remote) works: hand gestures and a phone laser pointer for your slides
- How I reverse-engineer a viral video edit into code, cut by cut
- Time-aware RAG: how I built AsOf to answer “what was the GST rule on date X?”
- Why WebSocket responses disappear in Kubernetes, and how Redis Pub/Sub fixes it