Sreeram Meka:
If we want to configure a static pod on a specific worker node, can’t we use nodeName
parameter as part of pod spec instead of creating the pod config file on controlplane node and then copying it to the staticPodPath
location as mentioned in the kubelet config.
This will allow us to schedule the node on that specific worker node by applying the config from the controlplane node itself.
Sergei Diachenko:
You can do it for regular pods. But main idea of static pods is that static pods can be run without control plane at all, if control plane is unavailable by some reasons.
For example you run etcd in static pod because kbue-apiserver cannot start without it; then kubelet runs etcd pod and after that kube-apiserver can start and run all other non-static pods.
By the way if you install cluster via kubeadm, all control plane components run as static pods (apiserver, scheduler, controller-manager, etcd). So kubelet runs control plane as static pods and control plane runs other regular pods.
Sreeram Meka:
Thanks @Sergei Diachenko for the nice explanation.