Skip to content
BENIBIX Learn

Linux Namespace vs Kubernetes Namespace

People think a Kubernetes namespace is a Linux namespace, and it is not. A Linux namespace is a wall inside one computer. It hides the other programs from a container. A Kubernetes namespace is a label. It splits a cluster into groups, such as one per team. By itself, it walls nothing off.

Infrastructure☸️ Container Orchestration

Kubernetes Namespace

A named area in one Kubernetes cluster. It keeps teams and apps apart.

A Kubernetes namespace splits one cluster into named areas. Each name only has to be unique inside its own namespace. So two teams can both have an app called web. Rules and limits can be set per namespace. A new cluster starts with four, and your work goes in the one called default unless you say otherwise.

Example
Jack's cluster has a shop-test and a shop-live namespace. Both hold an app called web, and a test run can only touch shop-test.
Why it matters
Namespaces let many teams share one cluster safely. Each can have its own rules and its own share of the machines.
Full entry
Infrastructure📦 Containers

Linux Namespace

A Linux trick that gives programs a private view of the system. Each box is built on it.

A Linux namespace gives a group of programs their own private view of one part of the system. In a process namespace, the programs see only each other. In a network namespace, they get their own network cards and ports. Linux has eight kinds. They also cover files, users and the computer's name. A container is mostly a program started inside a set of these.

Example
Lucy runs ps inside a container and sees one process. On the host, the same command lists hundreds.
Why it matters
Namespaces are why a container cannot see the programs around it. They are the walls of the box.
Full entry

In one line

Kubernetes Namespace
A named area in one Kubernetes cluster. It keeps teams and apps apart.
Linux Namespace
A Linux trick that gives programs a private view of the system. Each box is built on it.