Practice Test - Manual Scheduling
- Take me to Practice Test
Solutions to Practice Test - Manual Scheduling
-
A pod definition file nginx.yaml is given. Create a pod using the file.
kubectl create -f nginx.yaml -
What is the status of the created POD?
kubectl get podsExamine the
STATUScolumn -
Why is the POD in a pending state?
Inspect the environment for various kubernetes control plane components.kubectl get pods --namespace kube-systemThere is a key pod missing here!
-
Manually schedule the pod on node01.
We will have to delete and recereate the pod, as the only property that may be edited on a running container is
imagevi nginx.yamlMake the following edit
--- apiVersion: v1 kind: Pod metadata: name: nginx spec: nodeName: node01 # add this line containers: - image: nginx name: nginxkubectl delete -f nginx.yaml kubectl create -f nginx.yaml -
Now schedule the same pod on the controlplane node.
Repeat the steps as per the previous question. Edit
nodeNameto becontrolplane