Difficulty: Advanced
What are Static Pods in Kubernetes, how are they different from normal Pods, and why does kubeadm use them for the control plane?
Static Pods are Pods that the kubelet on a node runs directly from manifest files in a local directory (on kubeadm clusters, /etc/kubernetes/manifests), without the API server or scheduler being involved. The kubelet watches that directory, starts any Pod defined there, and restarts it if it dies. To make them visible, the kubelet creates a read-only mirror Pod in the API server, but you cannot manage the real Pod through kubectl.
staticPodPath in the kubelet's configuration file (the older --pod-manifest-path flag is deprecated). The kubelet can also fetch manifests from a URL.kube-apiserver-cp-1.There is a chicken-and-egg problem: you cannot schedule the API server through the API server before it exists. kubeadm solves this by writing static Pod manifests for:
etcdkube-apiserverkube-controller-managerkube-schedulerThe kubelet on each control plane node starts them from disk. Once the API server is up, mirror Pods appear in kube-system, so kubectl get pods -n kube-system shows them like any other Pod. Upgrading a component, such as adding an API server flag, means editing the manifest file on that node.
Managed services (EKS, GKE, AKS) hide the control plane entirely, so you mostly meet static Pods on self-managed kubeadm clusters, in CKA exam tasks, and in local tools like kind.
| Static Pod | DaemonSet Pod | Deployment Pod | |
|---|---|---|---|
| Created by | kubelet from a local file | DaemonSet controller | ReplicaSet controller |
| Needs API server to start | No | Yes | Yes |
| Scheduler involved | No | Yes (default scheduler) | Yes |
| Managed with kubectl | No, only a mirror Pod | Yes | Yes |
| Runs on | The node with the file | Every eligible node | Wherever scheduled |
kubectl delete pod kube-apiserver-cp-1 only deletes the mirror Pod; the kubelet recreates it almost immediately. Remove or move the manifest file to stop it.hostPath.kubectl stops working. Debug on the node with crictl ps -a, crictl logs <id> and journalctl -u kubelet.staticPodPath in /var/lib/kubelet/config.yaml.# On a control plane node: where does the kubelet look?
sudo grep staticPodPath /var/lib/kubelet/config.yaml
# staticPodPath: /etc/kubernetes/manifests
ls /etc/kubernetes/manifests
# etcd.yaml kube-apiserver.yaml kube-controller-manager.yaml kube-scheduler.yaml
# From anywhere: mirror Pods carry the node name suffix
kubectl get pods -n kube-system -o wide | grep cp-1
# If the API server is down, debug with the runtime directly
sudo crictl ps -a | grep kube-apiserver
sudo journalctl -u kubelet --since "10 min ago"
Static Pods are managed through files on the node, so debugging them often happens on the node with crictl and journalctl.
# Save as /etc/kubernetes/manifests/node-probe.yaml on the node
apiVersion: v1
kind: Pod
metadata:
name: node-probe
namespace: kube-system
spec:
containers:
- name: probe
image: busybox:1.36
command: ["sh", "-c", "while true; do date; sleep 60; done"]
The kubelet starts this as soon as the file appears; deleting the file is the only way to stop it permanently.
Static Pods, Kubelet, Mirror Pods, staticPodPath, Control Plane Bootstrap