skip to content
Alvin Lucillo

Static pods

/ 1 min read

A static pod is managed by a kubelet in a node, whereas regular pods are managed in the control plane by a deployment, for example. A static pod is not controlled by the API server but it’s visible on it. This type of pod is usually used by setting up kubernetes components like etcd and scheduler.

kubelet periodically looks for the pod manifests from a certain location and creates pods based on them.

Look for the --config flag in the kubelet service: ps -aux | grep kubelet. Example:

ps -aux | grep kubelet
root        3364  0.0  0.1 2931756 97000 ?       Ssl  11:09   0:12 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --container-runtime-endpoint=unix:///var/run/containerd/containerd.sock --pod-infra-container-image=registry.k8s.io/pause:3.10

When you check the config file (.e.g, /var/lib/kubelet/config.yaml) from the --config flag, you’ll see the kubelet config definition:

apiVersion: kubelet.config.k8s.io/v1beta1
-- ....
staticPodPath: /etc/kubernetes/manifests

/etc/kubernetes/manifests is where the manifests are located.

ls /etc/kubernetes/manifests
etcd.yaml  kube-apiserver.yaml  kube-controller-manager.yaml  kube-scheduler.yaml