Solutions to the practice test - static pods
Run the command kubectl get pods –all-namespaces and look for those with -controlplane appended in the name
Which of the below components is NOT deployed as a static pod?
Which of the below components is NOT deployed as a static POD?
Run the kubectl get pods –all-namespaces -o wide
Run the command ps -aux | grep kubelet and identify the config file - –config=/var/lib/kubelet/config.yaml. Then checkin the config file for staticPdPath. |
Count the number of files under /etc/kubernetes/manifests
Check the image defined in the /etc/kubernetes/manifests/kube-apiserver.yaml manifest file.
Create a pod definition file in the manifests folder. Use command kubectl run –restart=Never –image=busybox static-busybox –dry-run -o yaml –command – sleep 1000 > /etc/kubernetes/manifests/static-busybox.yaml
Simply edit the static pod definition file and save it
OR
Identify which node the static pod is created on, ssh to the node and delete the pod definition file. If you don’t know theIP of the node, run the kubectl get nodes -o wide command and identify the IP. Then SSH to the node using that IP. For static pod manifest path look at the file /var/lib/kubelet/config.yaml on node01