Static pods
In Kubernetes, static Pods are Pods managed directly by the kubelet daemon on a specific node, bypassing the Kubernetes API server. This means they are not scheduled by the control plane and are not subject to typical Kubernetes management features like Deployments or DaemonSets.
🔧 Key Characteristics of Static Pods
- Node-specific: Static Pods are tied to the node where their manifest file resides. They cannot be scheduled across multiple nodes automatically.
- Managed by kubelet: The
kubeletmonitors a designated directory (commonly/etc/kubernetes/manifests) for Pod manifest files. Upon detecting a manifest, it creates and manages the Pod accordingly. - Mirror Pods: For visibility, the
kubeletcreates a corresponding “mirror Pod” on the API server. While these mirror Pods appear inkubectl get podsoutputs, they cannot be controlled via standard Kubernetes commands. - Limited Feature Support: Static Pods do not support certain Kubernetes features, such as referencing other API objects (e.g., ConfigMaps, Secrets) or using ephemeral containers.
🛠️ Use Cases
Static Pods are primarily used for critical system components that need to run before the Kubernetes control plane is fully operational. For instance, when initializing a cluster with kubeadm, components like the API server and controller manager are deployed as static Pods.
📌 Managing Static Pods
- Creation: Place a Pod manifest file in the
kubelet’s monitored directory (staticPodPath). - Modification: Edit the manifest file directly on the node. Changes are detected by the
kubelet, which updates the Pod accordingly. - Deletion: Remove the manifest file from the directory. The
kubeletwill terminate the corresponding Pod.
⚠️ Considerations
While static Pods offer a way to run essential services independently of the Kubernetes control plane, they come with limitations. They lack the flexibility and features provided by standard Kubernetes objects. For workloads that require deployment across multiple nodes or integration with Kubernetes features, using controllers like DaemonSets is recommended.
For a comprehensive guide on creating and managing static Pods, refer to the official Kubernetes documentation: (Kubernetes).