Question
One static pod web-static with image busybox, is currently running on controlplane node, move that static pod to run on node01, don't need to do any other changes.
Note: static pod name should be changed from web-static-controlplane to web-static-node01
Answer
Get some details:
kubectl get po
kubectl get po -o wide
we can see one static pod running on controlplaneps aux | grep kubelet
the --config path value is /var/lib/kubelet/config.yamlgrep staticPod /var/lib/kubelet/config.yaml
The static pods path dir is /etc/kubernetes/manifestsls etc/kubernetes/manifests
cat static.yaml
SSH to the node01 and repeat the procedure:
ssh node01
ps aux | grep kubelet
grep staticPod /var/lib/kubelet/config.yaml
The static pods path dir is /etc/kubernetes/manifestsscp /etc/kubernetes/manifests/static,yaml node01:/etc/kubernetes/manifests/static.yaml
rm /etc/kubernetes/manifests/static,yaml
Wait some time and get the status:
kubectl get po -o wide
You should have web-static-node01 pod running