![](https://scriptcrunch.com/wp-content/uploads/2024/01/Kubeadm.png)
How to Create Static Pod on the Kubeadm Cluster
- Last Updated On: January 26, 2024
- By: Aswin Vijayan
In this example, I am going to show you how to create a static pod on the Kubedam cluster for the nginx web server.
Step 1: Create a Manifest file
First, we need to create a YAML manifest file for the nginx static pod, to create the manifest file run the following command
kubectl run nginx --image=nginx --dry-run=client -o yaml > nginx.yaml
This command will create a manifest file for nginx to run as a static pod. If you need to make any changes to the manifest file use the command below
vi nginx.yaml
A small portion of the nginx.yaml file is shown below.
![Create Static Pod on the Kubeadm Cluster: static pod yaml file](https://scriptcrunch.com/wp-content/uploads/2024/01/image-9.png)
Step 2: Validate the Manifest file
The next step is to validate the manifest file, to validate we can use the Kubeval utility.
If you don’t have Kubeval installed in your system run the following command to install it.
wget https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz
tar xf kubeval-linux-amd64.tar.gz
sudo cp kubeval /usr/local/bin
To verify if Kubeval is installed properly run the below command
kubeval --version
You will get the following output.
![Create Static Pod on the Kubeadm Cluster: verifying kubeval verison](https://scriptcrunch.com/wp-content/uploads/2024/01/image-10.png)
Now, run the following command to validate the manifest file.
kubeval nginx.yaml
You will get the following output if the manifest file is created according to the Kubernetes requirements.
![Create Static Pod on the Kubeadm Cluster: Validating manifest file using Kubeval](https://scriptcrunch.com/wp-content/uploads/2024/01/image-11.png)
Step 3: Deploy the Nginx Static pod
To deploy the static pod, you have to copy the nginx.yaml manifest to the static pod manifest location.
/etc/kubernetes/manifests/ is the location where every static pod manifest file is present.
The manifest files in this directory are deployed by Kubectl, Kubectl deploys the static pod during the booting time and keeps it running without the involvement of Controlplane.
Now, run the following command to move the nginx manifest file to the /etc/kubernetes/manifests/ directory.
sudo mv nginx.yaml /etc/kubernetes/manifests/
Step 4: Verifying Static Pod
Verify if your nginx pod has been deployed automatically without giving the apply command. Use the below command to check if the pod is up and running
kubectl get po
Static pods cannot be deleted until the manifest file is removed from the /etc/kubernetes/manifests/ directory.
Even if you delete the static pod using the delete pod command, a new pod will be created within a minute.
The only way to delete a static pod is to remove the static pod manifest file from the /etc/kubernetes/manifests/ directory.
![Create Static Pod on the Kubeadm Cluster: Static pod testing commands](https://scriptcrunch.com/wp-content/uploads/2024/01/image-8.png)
You can see in the above image, that the static pod cannot be deleted until the static pod manifest file is removed from the /etc/kubernetes/manifests/ directory.
Conclusion
In summary, we learned about Kubernetes static pod, their manifest file location, and how it is created.
I believe this blog gives you simple knowledge about Kubernetes Static Pods.
![](https://scriptcrunch.com/wp-content/uploads/2024/01/Kubeadm.png)
Aswin Vijayan
Other Interesting Blogs
![CKA Exam Guide](https://scriptcrunch.com/wp-content/uploads/2020/09/cka-exam-guide--300x176.png)
CKA Certification Study Guide (Certified Kubernetes Administrator)
This comprehensive CKA certification exam study guide covers all the important aspects of the Certified Kubernetes Administrator exam and useful resources. Passing
![CKA Exam Guide](https://scriptcrunch.com/wp-content/uploads/2020/09/cka-exam-guide-.png)
![Linux Foundation LFCA & LFCS](https://scriptcrunch.com/wp-content/uploads/2022/07/lfcs-lfca-300x176.png)
[40% OFF] Linux Foundation LFCA, LFCS & LFCT Exam Voucher Codes
Linux Foundation has announced up to a $284 discount on its Linux certification programs Linux Foundation Certified IT Associate (LFCA) and Linux
![Linux Foundation LFCA & LFCS](https://scriptcrunch.com/wp-content/uploads/2022/07/lfcs-lfca.png)
![Exclusive Linux Foundation Coupon Codes](https://scriptcrunch.com/wp-content/uploads/2023/11/linux-foundation-coupon-300x176.png)
Linux Foundation Coupon for September 2024
Hi Techies, I wanted to let you know about a pretty sweet deal with the Linux Foundation Coupon that is running now.
![Exclusive Linux Foundation Coupon Codes](https://scriptcrunch.com/wp-content/uploads/2023/11/linux-foundation-coupon.png)