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

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Creating a static Pod

Creating a static Pod

- Okay, next task is to create a static pod. Configure a pod with the metadata name set to lab158pod that will run the nginx image and be started by the kubelet on the node worker2 as a static pod. A one observation, the metadata name. Up to now you have always read about the name. What does that mean? That means that you need to make sure it's set correctly in the metadata and you don't have to do anything about the fact that when a static pod is running, the host name is appended to the metadata name. So that makes it clear that we don't have to worry about it. Well, that's only good, so let's do it. And how would I go on for this one? Well, I would generate some yaml code. So kubectl run lab158pod - - image=nginx - - dry run=client and - o yaml. That's what we are going to copy. And then it needs to run as a static port on worker2. So sudo vim /etc/kubernetes/manifests. And in that directory I'm creating lab158pod. I would always advise you to be consistent in the naming of your…

Contents