Hi, according to 74. Static pods the kubelet.service file will contain infos to find the configuration path used for static pods in the ExecStart directive, either by directly specifing it through --pod-manifest-path or by pointing at a config file using --config.
Question 10 in the Practice Test - Static PODs:
We just created a new static pod named static-greenbox. Find it and delete it.
This question is a bit tricky. But if you use the knowledge you gained in the previous questions in this lab, you should be able to find the answer to it.
To locate the pod’s definition path I searched for said kubelet.service file in the whole system of node01. I found one in /usr/lib/systemd/system/. The ExecStart directive has not a single option specified. That means the info given in video 74 is not helpful.
So I fell back to do a grep -R 'greenbox' /etc and got lucky. But I don’t like such a dirty approach.
The solution
In section 76 the instructor presents us /var/lib/kubelet as if it were the obvious location for the kubelet configuration files. I’d love to know how I am supposed to know that.
The instructor presented two ways of possible configuration but neither is used on the lab system.
He did not mention the third way that is actually in use, and how one would find that.
BTW: Using ps aux I later found the actual config supplied (... --config=/var/lib/kubelet/config.yaml ...). But it remains unknown to me where that is set, if not in a .service file.
You’re learning this in this lab via the solution, although another thing to do in a lab like this is to search the K8s documentation if you don’t know this already. Knowing how to find things in the docs is essential for doing the exam successfully, so if something comes up in a lab you don’t know, it’s important to try it. The course may not have everything you want where you want it; but it should push you to use your skills to find information quickly and reliably.
As for finding this from systemd, first:
controlplane ~ ➜ systemctl status kubelet
● kubelet.service - kubelet: The Kubernetes Node Agent
Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset:>
Drop-In: /usr/lib/systemd/system/kubelet.service.d
└─10-kubeadm.conf
Active: active (running) since Wed 2025-02-26 21:34:32 UTC; 4min 31s ago
Docs: https://kubernetes.io/docs/
So the file is /lib/systemd/system/kubelet.service. It turns out the easiest way to find where the config file is to run systemctl status kubelet through the less command, which shows you this:
what I’m trying to say is: In the solution video the instructor goes into details about trivial things, like showing how it is not possible to permanently delete the static pod via kubectl delete, but when it comes to the non trivial part how to actually find the configuration location in a way that the lecture did not mention ( /var/lib/kubelet/config.yaml) he does not tell us how he did that. But isn’t that the purpose of a solution video?
On the one hand the instructor thinks he needs to hold my hand doing the most basic steps, but than he skips over the more complex part of things? Please think about it and tell me if you don’t consider this being a little out of balance.
I am all for using the docs to help myself, and I actually tried that here (albeit without success). But when I get specific and detailed instructions on where a certain config is set but no hint about additional possibilites, than I assume this is the complete information about this very topic. When you say “There are options A and B” I do not expect there to be a hidden option C that you just happen to not tell me about for what ever reason.
Thanks for pointing me towards systemctl status kubelet. I shure should have thought about this. But, while that shows me the path to the config file, it still doesn’t explain where that path is actually set. It’s not in /lib/systemd/system/kubelet.service. So where?