Namespaces let you divide a single Kubernetes cluster into smaller, virtual clusters. This is useful when multiple users or teams share the same cluster. Resources inside each namespace must have unique names, but the same names can exist in different namespaces.
You can see all namespaces using:
kubectl get namespacesKubernetes includes 4 default namespaces:
- default, for user-created resources when no namespace is specified
- kube-system, holds system components (like control plane agents)
- kube-public, public and readable by anyone (for non-sensitive info)
- kube-node-lease, tracks node heartbeat data
You can create your own namespaces to organize and isolate users, teams, or applications:
kubectl create namespace my-namespaceNamespaces support multi-tenancy, making Kubernetes ideal for large, shared environments.
To manage resources in namespaces:
- Use ResourceQuotas to limit total resource usage
- Use LimitRanges to set limits for individual containers