Kubernetes namespace

A named area inside a cluster that keeps object names apart and groups them for permissions, quotas and policies.

In more detail

Two teams can each have a Service called web if they use different namespaces. Pods, Services and Deployments are namespaced, while nodes, PersistentVolumes and StorageClasses are cluster-scoped. A context can set a default namespace, and -n picks one for a single command; this is not the same thing as a Linux namespace.

Examples

kubectl get pods -n course-web -l app=web
kubectl label namespace payments pod-security.kubernetes.io/enforce=restricted
Many permissions, rules and exceptions are scoped by namespace, such as a Falco exception that applies only to the backup namespace.
A Role is namespaced, so it grants nothing outside its namespace, and the course treats the namespace as a real permission boundary.

Related terms

Taught in

References

Certification courses