A Static Pod is a pod that is directly managed by the kubelet (node agent) instead of the Kubernetes API server. It is managed locally by kubelet by creating YAML file directly on the Node by connecting node and create static pod with yaml file directly by using Kubectl apply command.
👉 Normal pods:
- Created using
kubectl apply - Managed by API server, scheduler, etc.
👉 Static pods:
- Created by placing a YAML file on the node
- Managed locally by kubelet only
- No scheduler, no controller
Where Static Pods are Used (Real Example)
In most Kubernetes clusters (especially kubeadm):
Control plane components run as static pods:
- kube-apiserver
- kube-controller-manager
- kube-scheduler
- etcd
These YAML files are usually stored here:
/etc/kubernetes/manifests/
How Static Pods Work (Flow)
- kubelet watches a directory:
/etc/kubernetes/manifests/ - You place a YAML file there
- kubelet:
- Reads the file
- Creates the pod
- Ensures it is always running
- If the file is deleted → pod is deleted
Example Static Pod YAML
First connect with the Node directly then Create file on node:
As seen in standard pod definitions, YAML requires fields like apiVersion, kind, metadata, and spec
/etc/kubernetes/manifests/nginx-static-pod.yaml
apiVersion: v1kind: Podmetadata: name: nginx-static labels: app: nginxspec: containers: - name: nginx image: nginx ports: - containerPort: 80
How to Verify Static Pod
Even though it’s not API-controlled, you will still see it:
kubectl get pods -o wide
mportant Behavior
1. Restart behavior
- kubelet restarts static pod automatically if it crashes
2. No Deployment support
- You cannot scale it like
kubectl scale deployment
3. Mirror Pod (important concept)
- Kubernetes creates a mirror pod in API server
- That’s why
kubectl get podsshows it
Static Pod vs Normal Pod (Quick Comparison)
| Feature | Static Pod | Normal Pod |
|---|---|---|
| Created from | Local file | kubectl/API |
| Scheduled | ❌ No | ✅ Yes |
| Managed by | kubelet | API + controllers |
| Scaling | ❌ No | ✅ Yes |
| Use case | System-level | Application workloads |