0

I have deployed a kubernetes cluster (1 master and 2 worker)on my local laptop using kubeadm.

Noted that the kubelet is running on master node as well. From the articles i have read earlier, kubelet is only needed on worker nodes. Can someone let me know why the kubernetes master node has kubelet service running?

David Maze
  • 130,717
  • 29
  • 175
  • 215
Lijo
  • 93
  • 3
  • 10

2 Answers2

6

The reason is that kubeadm uses containers (pods) to deploy etcd and the api server components. For this static manifests are created as yaml-files which are picked up by the kubelet on the master node to provide the infrastructure pods.

An added benefit is that you have the master node metrics available from the kubernetes api.

Thomas
  • 11,272
  • 2
  • 24
  • 40
  • Is this is the case only with cluster deployment using kubeadm? Also kubelet on master is only required at the time of initial infrastructue components deployment? once the cluster is deployed can kublet be stopped/removed? – Lijo Oct 21 '19 at 07:51
  • 1
    Right this is how kubeadm works, other methods could use native systemd units for example. The kubelet should not be stopped/removed since it is used to ensure that the infrastructure pods keep running and last, but not least, the kubeadm cluster upgrade uses static manifests as well. So just keep it going. – Thomas Oct 21 '19 at 07:56
  • Thanks Thomas for the info – Lijo Oct 21 '19 at 08:43
0

Kubelet is Kubernetes agent for managing Pods. There are some Pods running on your Master nodes, too. For example, your network Pods, your etcd Pods (if you haven't provided its cluster yourself), and any other Pods that you run on your Master nodes (a node exporter, log collector, etc.) or any DaemonSet that you didn't tolerate them not to get scheduled on your Master nodes are kinds of Pods that run on your Master. So Kubernetes needs Kubelet to manage them.

Ali Tou
  • 2,009
  • 2
  • 18
  • 33