Static pods

Static pods ———> pods created by kubelet agent on worker nodes

Assume you have only one worker node on cluster and no control plane and you need to create pods.

These pods are created by kubelet agent.

How to path configuration files for pods to kubelet ?

kubelet is configured to read pod definition from path you can configure which path.

—pod-maniftest-path=/path

or —config=filex.yml

filex.yml

staticPodPath=/path


kubelet works on pod level not support any other k8s object

How to list created static pods ?

$ docker ps # because we’re running on single worker node

kube-api server if exists is aware of static pods but cann’t edit them.

use cases————>

Deploy control plane components as static pods


Differences between Daemonstes && static Pods ?

Daemonstes ————→

1) Created by kube-apiserver

2) single copy of pod on each node in cluster

3) monitoring agent, Networking , logging agent

4) Ignored by kube-scheduler

static Pods ——————→

1) Created bu kubelet

2) deploy control plane component as static pods

3) Ignored by kube-scheduler


If you are in cluster and need to see static pods ?

$ kubectl get pods

pod_name-node_name

like this etcd-controlplane

————————————————————————————-

If you try to get path for static pod manifest on worker

on /var/lib/kubelet/config.yml ———→ search for staticpod