Static pods in Kubernetes

Static Pods are always bound to one Kubelet on a specific node. The kubelet automatically tries to create a mirror Pod on the Kubernetes API server for each static Pod.

This means that the Pods running on a node are visible on the API server, but cannot be controlled from there. If the static pod crashes, kubelet restarts them. Control plane is not involved in lifecycle of static pod.

One of the use case of static pod is kubernetes control plane bootstrapping. Kubeadm while bootstarping a kubernetes cluster creates API Server, controller manager , kube scheduler as a static pod because it can not create these as normal pod due to the fact that kube Api Server itself is not available yet.

The static pod name will automatically be appended with the node name like if you created the pod with the name web1, it will be created with web1-node01.

Static pod directory path location examples:

  1. ps aux | grep kubelet
    Find in the options --pod-manifest-path=/etc/kubernetes/manifests/ argument. That path is the path for static pods
  2. ps aux | grep kubelet
    Find --config=/var/lib/kubelet/config.yaml
    Open /var/lib/kubelet/config.yaml and inside of it search for staticPodPath - that path is the path for static pods