Skip to content
BENIBIX Learn

Kubernetes Namespace

Infrastructure☸️ Container OrchestrationKubernetes

Also known as K8s Namespace, Namespace (Kubernetes), kube-system

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

Think of it like

It is like rooms in one house. Each room can have its own lamp, with the same name.

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.

Definition

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 code

console
$ kubectl get namespace
NAME              STATUS   AGE
default           Active   1d
kube-node-lease   Active   1d
kube-public       Active   1d
kube-system       Active   1d
A new cluster starts with these four. Your own apps go in default until you make more.
Three namespaces, three pods called web. The same name is fine because each lives in its own area.

Common mistake

Thinking a namespace is a wall for security on its own. It only splits names; you still need access rules on top.

Key takeaways

  1. 1
    Names stay local. Unique inside a namespace, not across them.
  2. 2
    Rules per area. Limits and access are set per namespace.
  3. 3
    One level only. A namespace cannot hold another one.

Compare