...

/

Kubernetes Worker Nodes

Kubernetes Worker Nodes

Learn what worker nodes do in Kubernetes.

We'll cover the following...

Components of worker nodes

On worker nodes, two Kubernetes components are running—kubelet and kube-proxy.

How kubelet works

The kube-apiserver, kube-scheduler, and kube-controller are running on the control plane nodes, while kubelet runs on worker nodes where actual containers run. The kubelet nodes are the workhorses of a Kubernetes cluster. They expose computational, networking, and storage resources to containers. We can run the kubelet on bare-metal servers, virtual machines (VMs), etc.

In a nutshell, the kubelet talks to the kube-apiserver and manages the containers running on it.

The kubelet, on start-up, registers itself to the kube-apiserver by creating a dedicated Node resource. Then, the kube-scheduler can see this Node and assign new Pods running on it.

We can view all the nodes with the commands given below:

Shell
# list all the nodes
kubectl get node
# view nodes with extra infomation
kubectl get node -o wide

Now, let’s run the commands above in the terminal below:

Terminal 1
Terminal
Loading...

The output will be as follows:

Markdown
NAME STATUS ROLES AGE VERSION
educative-demo-control-plane Ready control-plane 53s v1.24.0
educative-demo-worker NotReady <none> 16s v1.24.0
educative-demo-worker2 NotReady <none> 15s v1.24.0

Here’s a detailed view of the nodes:

Markdown
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
educative-demo-control-plane Ready control-plane 58s v1.24.0 172.19.0.3 <none> Ubuntu 21.10 4.19.197 containerd://1.6.4
educative-demo-worker NotReady <none> 21s v1.24.0 172.19.0.2 <none> Ubuntu 21.10 4.19.197 containerd://1.6.4
educative-demo-worker2 NotReady <none> 20s v1.24.0 172.19.0.4 <none> Ubuntu 21.10 4.19.197 containerd://1.6.4

Its heartbeats are reported periodically by the kubelet. The status of the nodes can be determined by observing their STATUS column in the terminal. When a node crashes or stops reporting heartbeats for a while, it will be tainted and marked as NotReady by the ...