Components of Manager and Worker Nodes

Let’s learn about the components of manager and worker nodes in Kubernetes’ architecture and explore the concurrency control mechanism in Kubernetes.

Components of the manager node

The main components of the manager node are the API Server (kube-apiserver), the Scheduler (kube-scheduler), and the Controller Manager (kube-controller-manager).

The API Server (kube-apiserver)

The API Server is the front-end of the Kubernetes cluster, allowing users to inspect the resources of the cluster and modify them or create new ones.

The Scheduler (kube-scheduler)

The Scheduler detects newly created pods that have no nodes assigned and selects a node for them to run.

Note that this selection of Scheduler is based on multiple criteria, such as user-specified constraints, affinity specifications, data locality, etc.

The Controller Manager (kube-controller-manager)

The Controller Manager runs all the available controllers in the manager node. A controller is a control loop that watches the state of the cluster through the API server making changes in order to move the current state towards the desired state

Below are some examples of controllers:

  • Node Controller: responsible for noticing and responding to node failures
  • Replication Controller: responsible for maintaining the correct number pods according to the replication specified by the user.
  • Endpoints Controller: responsible for creating endpoints for services.

Note: We have already studied the following illustration in the previous lesson as well. This illustration will make it easier for the reader to follow the components of manager and worker nodes.

Press + to interact
Kubernetes architecture
Kubernetes architecture

Components of worker nodes

The main components of the worker nodes are the kubelet and the proxy (kube-proxy).

The kubelet

The kubelet is an agent that runs on each node in the cluster, receives a set of pod specifications, and makes sure the containers described in these specifications are running and are healthy.

The proxy

The proxy is a network proxy that maintains network rules that allow network communication to the pods from sessions inside and outside the cluster.

Note that the worker nodes also contain software of the container runtime that is used.

Need for the concurrency control mechanism

Kubernetes operates under eventual consistency, it recovers from potential failures and converges back to the desired state. Since multiple components read and update the current state of the cluster, there is a need for some concurrency control to prevent anomalies arising from reduced isolation.

Kubernetes achieves this with the use of conditional updates. Every resource object has a resourceVersion field representing the version of the resource as stored in etcd. This version is used to perform a compare-and-swap (CAS) operation so that anomalies like lost updates are prevented.

Get hands-on with 1400+ tech skills courses.