Core Idea
A static pod is defined by YAML in a directory the kubelet watches (
/etc/kubernetes/manifests): the kubelet alone creates and restarts it, with no API server or scheduler involved.
- Functionality and configuration: point the kubelet at a pod definition directory on the server.
- Use cases, plus how static pods compare to DaemonSets.
- Hands-on: create a static pod.
Overview
Static Pods are created directly by the kubelet on a node without the involvement of the Kubernetes control plane (API server, scheduler, etc.). They are defined in YAML files and placed in a specific directory (/etc/kubernetes/manifests), which the kubelet periodically checks.
Question
How do you provide a pod definition file to the kubelet without a kube-apiserver?
- You can configure the kubelet to read the pod definition files from a directory on the server designated to store information about pods.
Functionality
- The kubelet reads pod definition files from this directory to create and manage Pods. It ensures Pods are restarted if they crash and updates them when the file changes.
- Static Pods do not interact with the kube-scheduler and cannot be managed by kubectl directly as they do not go through the API server. Instead, they are mirrored in the API server as read-only objects.
Configuration
- The kubelet is configured to check the pod manifest directory (e.g.,
/etc/kubernetes/manifests) via its service file or a separate configuration file. The kubelet uses the--pod-manifest-pathoption to point to this directory.

Instead of specifying the option directly in the kubelet.service file, you could provide a path to another config file using the config option, and define the directory path as staticPodPath in the file.

Use Cases
- Static Pods are ideal for deploying control plane components like the API server, controller manager, etc., on master nodes. This setup simplifies deployment and recovery, as the kubelet automatically restarts these components if they fail.


Static Pods & Daemonsets

Create Static Pod
Static Pods
https://kubernetes.io/docs/tasks/configure-pod-container/static-pod/