Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 699 Bytes

kubernetes-namespace.md

File metadata and controls

31 lines (26 loc) · 699 Bytes

Namespace

⬅️ Back to Kubernetes overview

Explain namespaces, what is their use? Different environments: namespace vs. clusters

Create namespace

kubectl get namespace
kubectl create namespace test-env

📝 How many namespaces do you currently have on your system?

Create pod with same name in new namespace

kubectl run web --image nginx --port 80
kubectl run web --image nginx --port 80 --namespace test-env

Listing resources for specific namespaces

kubectl get pods
kubectl get pods --namespace=test-env
kubectl get pods --all-namespaces

Delete the created resources

kubectl delete namespace test-env
kubectl delete pod web