Kubernetes CKA sample exam question 9 with answer

Question
Create a pod called delta-pod in defence namespace belonging to the development environment (env=dev) and frontend tier (tier=front) with image nginx:1.17

Answer
Get all namespaces:

kubectl get ns
we can see that the defence namespace is not present
We have to create it first:
kubectl create ns defence
Create the pod
kubectl -n defence run delta-pod --image=nginx:1.17 --labels env=dev,tier=front
Verify:
kubectl -n defence get po --show-labels
kubectl -n defence describe po delta-pod | grep -i image