Namespace: Logical Isolation
Separate environments, permissions, and quotas with namespaces.
A Namespace is a logical isolation boundary inside the cluster. The most common pattern is dev, staging, and prod.
Common operations
kubectl create ns dev
kubectl get ns
kubectl config set-context --current --namespace=dev
Quotas and permissions
- ResourceQuota caps resource usage
- LimitRange sets default requests/limits
- RBAC controls who can access what
Tips
- Deleting a Namespace removes everything inside it
- Use separate kubeconfigs or contexts per environment
Practical notes
- Start with a quick inventory:
kubectl get nodes,kubectl get pods -A, andkubectl get events -A. - Compare desired vs. observed state;
kubectl describeusually explains drift or failed controllers. - Keep names, labels, and selectors consistent so Services and controllers can find Pods.
Quick checklist
- The resource matches the intent you described in YAML.
- Namespaces, RBAC, and images are correct for the target environment.
- Health checks and logs are in place before promotion.