Skip to main content

Command Palette

Search for a command to run...

Kubernetes - Static Pod

Updated
β€’2 min readβ€’View as Markdown

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:

  1. Install Kubelet on all master nodes.

  2. 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