Mayur Sharma:
I am on the lab – troubleshoot controlplane failures, and I do not find the kubelet service in the master node, can anyone tell me why it is not there or I am expecting it wrongly.
I expect the kubelet to be present on master node as controlplane components are deployed via kubeadm and components are deployed as static pod, so I think kubelet has installed all controlplane components as static pod
controlplane $ cd /etc/systemd/system/
controlplane $ ls
dbus-org.freedesktop.resolve1.service default.target.wants multi-user.target.wants sysinit.target.wants
dbus-org.freedesktop.timesync1.service getty.target.wants sockets.target.wants timers.target.wants
controlplane $
Karim Meslem:
Remember the analogy? The kubelet is the captain of the ship. The ship = worker node.
Mayur Sharma:
@Karim Meslem, Yes, I remember it, but wondering then how static pods are installed on master node then, who install it and where is the configuration to set the static pod directory as /etc/kubernetes/manifest
Karim Meslem:
defined by staticPodPath in the kubelet config file. first find the kubelet config file:
ps -ef | grep kubelet | grep config
outputs something like this:
Karim Meslem:
root 5143 1 0 11:19 ? 00:00:38 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=*/var/lib/kubelet/config.yaml* --network-plugin=cni --pod-infra-container-image=<http://k8s.gcr.io/pause:3.2|k8s.gcr.io/pause:3.2>
Mayur Sharma:
@Karim Meslem: Not following you, I am talking about master node, and there is no kubelet there. so cannot find the kubelet config file.
The commands you shared would work on worker node.
let me know if I am missing anything in your statements
Karim Meslem:
then open the file, e.g. /var/lib/kubelet/config.yaml and search for “staticPodPath”. This will point you to the manifests directory as configured on the system.
Karim Meslem:
this is on master node
Mayur Sharma:
how do you find the kubelet on master node
Mayur Sharma:
controlplane $ ps -ef | grep kubelet
root 620 12 0 11:40 pts/1 00:00:00 grep --color=auto kubelet
controlplane $
I got nothing
Karim Meslem:
ps -ef | grep kubelet?
Karim Meslem:
its not there in your controlplane node, but I might expect on the worker node to be there.
Karim Meslem:
I am not at that lab yet, so I was referring to your question of “where is the staic pod (manifests directory)” defined
Mayur Sharma:
On worker node kubelet is there, but I want to know for master node.
Rephrasing it here:
- how static pods are installed on master node then, I think kubeadm deos that but how, using which component, and
- where is the configuration to set the static pod directory as /etc/kubernetes/manifest
Mayur Sharma:
@Karim Meslem hope it clear now.
Karim Meslem:
perhaps part of the answer of that lab is that you have to create the kubelet yourself on the controlplane node. I don’t know
Mayur Sharma:
@Karim Meslem: no, the question was totally different and I could solve that.
Doubt got raised after I notice that all components on controlplane are installed are static pods.
So, someone has to installed it, who is it? I beleive kubeadm.
Then, how the static pod directory is configured and who looks it for auto scheduling if kubelet is not there.
Karim Meslem:
now I’m confused scheduling (decision) is done by the scheduler, not the kubelet.
Mayur Sharma:
static pods and daemon sets are not scheduled by scheduler
Karim Meslem:
yeah, let me stick to what I know: kubelet and kube-proxy are worker node components and I wouldn’t expect them to be present on a contolplane node.