From the course: Certified Kubernetes Administrator (CKA) Cert Prep (2024)

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Creating a static Pod

Creating a static Pod

- All right, next assignment is to create a static pod. "Configure a Pod with the name lab129pod that will be started by the kubelet on node worker2 as a static Pod." So what was this static pod again? A static pod is a pod that is picked up by the kubelet and comes from /etc/kubernetes/manifests. We just need to dump a YAML file in there and make sure the YAML file is the appropriate code. So I'm going to generate the code on the command line and copy it manually over to worker2. So kubectl run lab129pod - -image=nginx. It doesn't even ask which image to use, but that doesn't matter. - -dry-run=client - o yaml. And this is the YAML code. So, let me copy the YAML code. And bring it to worker2. In which? In /etc/kubernetes/manifests, we'll find the static pod definition. So sudo vim lab129pod.yaml. And pasting the code in there. And now, I'm getting back to the control node where I'm typing kubectl get pods. And there we can see lab129pod with the name of the worker node appended. The…

Contents