Static pods in kubernetes

Yash Panchal
Jun 22, 2023

A Guide to static pod with example.

Static pods are created by the kubelet directly without any usage of kubernetes api.

How do we do this ?

This is due to a default path that kubelet uses, if you keep a manifest file the kubelet picks it up and applies it.

path: /etc/kubernetes/manifests

Example:

kubectl run nginx-pod-2 --image nginx --dry-run=client -o yaml > /etc/kubernetes/manifests/nginx-pod-2.yaml

Doing this on control plane node will not work as they are tainted by default.

On creating the file on db2 (worker node) it works.

The pods that are visible using kubectl get pods are called mirror pods that are created by kubelet for interface/viewability.

ancient ruins

--

--