Kubernetes - Static Pod

What is a Static Pod? ๐
Static Pods are created by Kubelet without the intervention of the kube-apiserver or any other control plane components.
Where is the Static Pod manifest location in a node? ๐
The manifest files for Static Pods are located in the /etc/kubernetes/manifests
folder.
How will Kubelet create a Pod without kube-apiserver? ๐
By default, Kubelet periodically checks the pod manifest location (e.g., /etc/kubernetes/manifests
). If there are changes in the manifest file or if the Pod crashes, Kubelet will automatically recreate the Pod.
Will Kubelet serve only Static Pod requests? โ
No, Kubelet processes both HTTP API requests (from the kube-apiserver) and Static Pods.
Will kube-apiserver be aware of the Static Pod created by Kubelet? โ
Yes! When Kubelet creates a Static Pod, it also creates a read-only mirror object in the kube-apiserver. This allows the Static Pod to be visible when running kubectl get pods
.
How to identify a Static Pod using kubectl get
command? ๐
The Pod name of a Static Pod is appended with the node name of the cluster where the Static Pod is running.
is it possible to create deployment,replicaset etc same like as static pod ? โ
No, it is not possible to create Deployment or ReplicaSet objects by placing their definition files under the /etc/kubernetes/manifests
directory.
For Deployments and ReplicaSets, the control plane (e.g., kube-apiserver and kube-controller-manager) is required.
How to delete a Static Pod? ๐๏ธ
Simply move the Pod definition file out of the Static Pod manifest directory (/etc/kubernetes/manifests
).
What is the primary use case of Static Pods? ๐ฏ
Since Static Pods do not depend on Kubernetes control plane components, they are often used to deploy control plane components themselves. For example:
Install Kubelet on all master nodes.
Place Pod definition files in the
/etc/kubernetes/manifests
directory, using Docker images for components like kube-apiserver, etcd, and kube-controller-manager.
This approach eliminates the need to download binaries or worry about service crashes for control plane components.
๐ ๐ Key Takeaways๐ ๐:
Static Pods are managed solely by Kubelet.
They are stored in
/etc/kubernetes/manifests
.Kubelet can manage both Static Pods and API-server-created Pods.
Static Pods are mirrored in the kube-apiserver for visibility.
Use Static Pods to bootstrap control plane components in a cluster.
#Kubernetes #StaticPods #Kubelet #ControlPlane #DevOps
Subscribe to my newsletter
Read articles from Sheik Mohamed Syed Ali directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
