- Identify static pods in the cluster
- Confirm a pod is static by inspecting
ownerReferences - Find the kubelet
staticPodPath - Count static pod manifest files
- Inspect the image used by a static pod (kube-apiserver example)
- Create a static pod by dropping a manifest into the
staticPodPath - Fix a misconfigured static pod image
- Permanently remove a static pod (delete its manifest on the node that hosts it)
staticPodPath) for manifest files and creates pods from them.
Static pods are created directly by the kubelet from manifest files on a node. Deleting a static pod via
kubectl delete pod only removes the API-visible Pod object — the kubelet will recreate it if the manifest file still exists. To permanently remove a static pod, delete its manifest from the node’s staticPodPath.Quick reference: static pods vs. controller-managed pods
References:
1) List all pods and spot static pods
List all pods across namespaces to locate candidates that look like static pods:kube-apiserver-controlplane indicates the pod runs on node controlplane). In this example, etcd, kube-apiserver, kube-controller-manager, and kube-scheduler are static pods; CoreDNS is not.
2) Confirm a pod is static by inspecting ownerReferences
A definitive way to tell if a pod is static is to inspect itsownerReferences in the pod YAML. A static pod will list its owner as a Node.
Example: inspect the kube-apiserver static pod:
3) Find the kubelet staticPodPath
The kubelet configuration file contains thestaticPodPath setting — the directory kubelet watches for manifest files.
On the node you want to inspect (example: controlplane), check the kubelet config:
4) Inspect the kube-apiserver static pod image
You can either open the manifest or inspect the API-visible pod YAML to find the container image used by a static pod. Example: view the manifest file:5) Create a static pod named static-busybox (busybox, sleep 1000)
Create a Pod manifest with kubectl run using --dry-run=client -o yaml and then place that manifest into the kubelet staticPodPath.
Important: when you use --command -- <cmd>, any kubectl global options must come before the --. Keep --dry-run=client -o yaml before --command --.
Generate the manifest and save it:
--image=busybox:1.28.4.)
Move the manifest into the staticPodPath (requires root privileges):
- If you put
kubectloptions after the--, they become part of the container command instead ofkubectloptions. - If the image cannot be pulled, pod status will show
ErrImagePullorImagePullBackOff. Verify the image name/tag and network access to the registry.
/etc/kubernetes/manifests/static-busybox.yaml and correcting the image: value. Kubelet will automatically apply the change.
6) Delete a static pod permanently
Akubectl delete pod will remove the API-visible Pod object, but kubelet will recreate it if the manifest remains on the node. To permanently remove a static pod, remove its manifest from the node’s staticPodPath.
Steps:
- Determine which node hosts the static pod (pod name suffix,
kubectl get pods -o wide, orkubectl get pod <name> -o yaml). - SSH to that node (find node IPs with
kubectl get nodes -o wide). - Inspect
/var/lib/kubelet/config.yamlon that node to confirmstaticPodPath. - Remove the manifest file from the
staticPodPath.
static-greenbox which runs on node01.
View pods:
When removing static pod manifests on a node, be careful: deleting critical control-plane manifests (for example, apiserver/etcd) will disrupt cluster control services on that node. Only remove manifests you intend to permanently delete, and ensure you have access to recover the node if needed.
That covers typical operations for static pods: identifying them, confirming ownership, locating kubelet’s
staticPodPath, creating static pods by placing manifests into that path, troubleshooting image issues, and permanently removing static pods by deleting the manifest on the node that hosts them.
Links and references: