Kubectl Namespaces

Isolate teams and environments with namespaces and quotas.

  • kubernetes namespace
  • kubectl ns
  • resource quota
  • isolate env
  • delete namespace

Kubectl Namespaces

Isolate teams and environments with namespaces and quotas.

Commands

CommandWhat it does
kubectl get nsList namespaces
kubectl create ns shopCreate one
kubectl get all -n shopEverything inside a namespace
kubectl delete ns shop-oldDelete a namespace and its contents
kubectl top pods -n shopResource usage per pod

Example

kubectl create ns shop
kubectl config set-context --current --namespace=shop
kubectl get all -n shop

FAQ

What does deleting a namespace do?

Deletes every namespaced object inside — a fast environment teardown, but irreversible.

How do I prevent one team starving others?

ResourceQuotas plus LimitRanges per namespace cap total and per-pod consumption.

คำถามที่พบบ่อย

What does deleting a namespace do?
Deletes every namespaced object inside — a fast environment teardown, but irreversible.
How do I prevent one team starving others?
ResourceQuotas plus LimitRanges per namespace cap total and per-pod consumption.

Kubernetes