Kubernetes > Sample tasks > Create namespaces
Task to create two NameSpaces Staging and Production
networkandcode@k8s-master:~ ls
README.md create-namespaces.yaml
networkandcode@k8s-master:~ cat README.md ; cat create-namespaces.yaml
Create NameSpaces
---
apiVersion: v1
kind: Namespace
metadata:
name: staging
...
---
apiVersion: v1
kind: Namespace
metadata:
name: production
...
networkandcode@k8s-master:~ kubectl create -f create-namespaces.yaml
Verify
networkandcode@k8s-master:~ kubectl get ns | grep -E '(staging|prod)'
production Active 45h
staging Active 45h
--end-of-post--