mikeLundquist
mikeLundquist

Reputation: 1009

Is the kubernetes kubelet a DaemonSet?

DaemonSets ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them.

The kubernetes kubelet runs on each node and keeps the other pods on the node running. In ch 4.4 of Kubernetes In Action by Marko Luksa, he says the kube-proxy is a DaemonSet but doesn't explicitly state that kubelets are.

Here's a picture of the kubernetes pod/node architecture that includes the kube-proxy and kubelets for reference.

Upvotes: 4

Views: 2537

Answers (3)

benjaminapetersen
benjaminapetersen

Reputation: 81

The short answer is no, but the longer answer is "it depends". If you setup an environment manually, such as by following something like Kubernetes the Hard Way, you will install and configure the Kubelet manually on each Node. It will run as a Daemon. Then, it will register the Node with the API server, and then the Kubelet will be utilized to schedule pods/containers to run on the Node. In this way, Kubelet cannot be a Kubernetes DaemonSet because it is needed to bootstrap the Node to begin with (you can't use Kubelet to schedule itself to the Node so that it can then schedule Pods).

However, cloud providers may do all kinds of interesting things to provision clusters in different ways, so I would not go as far as to say that kubelets are never DaemonSets.

Upvotes: 1

navinkbe7
navinkbe7

Reputation: 31

Kubelet is a node agent which runs on each k8s worker node as a daemon installed with a help of a service manager like systemd.

Kubelet is responsible to register your node with the k8s control plane and ensure pods are running on the worker node.

https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/

Upvotes: 1

DT.
DT.

Reputation: 3571

Kubelet is agent that runs on each node in the cluster. It makes sure that containers are running in a pod.

kubelet is a daemon, whe its installed using RPM systemd is configured to manage it.

From Master

$ ps -eauxf | grep -i kubelet

ubuntu@k8s-master:~$ ps -eauxf | grep -i kubelet
ubuntu   28702  0.0  0.0  12940   936 pts/0    S+   16:10   0:00              \_ grep --color=auto -i kubelet XDG_SESSION_ID=2 TERM=xterm SHELL=/bin/bash SSH_CLIENT=100.93.176.220 62935 22 SSH_TTY=/dev/pts/0 USER=ubuntu LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36: SSH_AUTH_SOCK=/tmp/ssh-62okU98ePE/agent.1543 MAIL=/var/mail/ubuntu PATH=/home/ubuntu/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin PWD=/home/ubuntu LANG=en_US.UTF-8 SHLVL=1 HOME=/home/ubuntu LOGNAME=ubuntu XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop SSH_CONNECTION=100.93.176.220 62935 131.160.188.46 22 LESSOPEN=| /usr/bin/lesspipe %s XDG_RUNTIME_DIR=/run/user/1000 DISPLAY=localhost:10.0 LESSCLOSE=/usr/bin/lesspipe %s %s _=/bin/grep OLDPWD=/etc/kubernetes/manifests

From Node

root@k8s-node01:/home/ubuntu#  ps -eauxf | grep -i kubelet
root     21492  0.0  0.0  12940   972 pts/0    S+   16:07   0:00                          \_ grep --color=auto -i kubelet SHELL=/bin/bash TERM=xterm USER=root LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36: SUDO_USER=ubuntu SUDO_UID=1000 USERNAME=root MAIL=/var/mail/root PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games PWD=/home/ubuntu LANG=en_US.UTF-8 SHLVL=1 SUDO_COMMAND=/bin/su HOME=/root LOGNAME=root LESSOPEN=| /usr/bin/lesspipe %s SUDO_GID=1000 DISPLAY=localhost:10.0 LESSCLOSE=/usr/bin/lesspipe %s %s _=/bin/grep
root     15579  2.0  0.5 844536 92880 ?        Ssl  13:02   3:46 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --cgroup-driver=systemd --network-plugin=cni --pod-infra-container-image=k8s.gcr.io/pause:3.1 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml KUBELET_KUBEADM_ARGS=--cgroup-driver=systemd --network-plugin=cni --pod-infra-container-image=k8s.gcr.io/pause:3.1

You can list the current daemon sets running on a deployment using a simple grep on all namespace. KubeProxy will be listed there.

$ kubectl get daemonset --all-namespaces  

kube-system   daemonset.apps/calico-node   3         3         3       3            3           beta.kubernetes.io/os=linux   169m
kube-system   daemonset.apps/kube-proxy    3         3         3       3            3           beta.kubernetes.io/os=linux   170m

Upvotes: 5

Related Questions