11.1 Production and staging environments using namespaces
View in the book.
Buy the book.
kubectl create namespace staging
kubectl config set-context --current --namespace=staging
Now we can create the Deployment, even if it already exists in the cluster in the default namespace
kubectl create -f Chapter03/3.2_DeployingToKubernetes
Compare the view of Pods from the current namespace (staging
)
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
timeserver-f94cc5dd9-6b7lv 0/1 Pending 0 49s
timeserver-f94cc5dd9-jg47t 0/1 Pending 0 49s
timeserver-f94cc5dd9-kskkw 0/1 Pending 0 49s
To the default namespace
$ kubectl get pods -n default
NAME READY STATUS RESTARTS AGE
redis-0 1/1 Running 0 38m
redis-1 1/1 Running 0 36m
redis-2 1/1 Running 0 35m