> For the complete documentation index, see [llms.txt](https://dev7days.gitbook.io/dev7days/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev7days.gitbook.io/dev7days/scheduling/static-pods.md).

# Static Pods

Static Pods is the one way the `kubelet` use to create the Pod without `kube-api-server` so it mean we didn't need to have cluster. \
\
The way we doing is configure the designator folder that we store the `pod-definition.yaml`  (pod template). Whenever this file is updated or removed, the corresponding Pod is automatically updated or removed accordingly.\
\
There are 2 option for configure this path folder:

1. `--pod-mainifest-path=/path` ( default path = /etc/Kubernetes/manifests )&#x20;
2. `-- config=kubec-config.yaml`  and inside the config file you need to add this property

`staticPodPath: /etc/Kubernetes/manifests`\
\
If we create the Pod which this way but we have `Master Node (have kube-api-server)`  the Node will be read only for this Pod It can only view but can't update or remove except you update or remove the definition file&#x20;

{% hint style="warning" %}
**Noted:**

* For the Pod that was created by kubelet the name of the Pod will always be \<pod\_name>-\<node\_name><br>
* It will ignore the Kube-scheduler<br>
  {% endhint %}

**UseCase**

* When the service is crash and restart we still can recover the Pod  by `kubelet` from definition file

**CheatSheet command**

1. Check the static pod path: `cat /var/lib/kubelet/config.yaml`
2. Create static pod: `kubectl run <pod_name> --image=<image_name> --restart=Never --dry-run=client -o yaml > <file_name>.yaml`
