Kubernetes Architecture

2 min read

A Kubernetes cluster is a set of nodes that run containerized applications. Kubernetes cluster is comprised of two main types of nodes, Master and Worker nodes. The Master node controls the state of the cluster. It is the origin of all task assignments. Worker nodes are the machines where containers (pods) run. They are managed by the control plane and are responsible for running applications. There must be a minimum of one master node and one worker node for a Kubernetes cluster to be operational. In a production environment, the cluster must be distributed across multiple worker nodes.

Master node components

馃敂 Kube-apiserver
馃敼 The API server is the front end for the Kubernetes control plane.
馃敼 It exposes the Kubernetes API, which is used by various components and users to interact with the cluster.

馃敂 Scheduler
馃敼 Scheduler places containers according to resource requirements and metrics.
馃敼 It makes note of pods with no assigned node and selects nodes for them to run on.

馃敂 etcd
馃敼 Consistent and highly available key-value store used as Kubernetes backing store for all cluster data. It stores all cluster data, including configuration data and the current state of the cluster.

馃敂 Controller manager
馃敼 Ensures that the desired state of the cluster matches the current state.
馃敼 There are many different types of controllers. Such as,
路 Node controller: Responsible for noticing and responding when nodes go down.
路 Job controller: Watches for Job objects that represent one-off tasks, then creates Pods to run those tasks to completion.
路 Endpoint controller: Populates Endpoint objects (to provide a link between Services and Pods).
路 Service Account controller: Create default Service Accounts for new namespaces.

馃敂 Cloud Control Manager
馃敼 Manages interaction with cloud providers if the cluster is hosted on a cloud platform.
馃敼 The cloud-controller-manager only runs controllers that are specific to your cloud provider.
馃敼 If you are running Kubernetes on your own premises, or in a learning environment inside your own PC, the cluster does not have a cloud controller manager.

Worker node components

馃敂 Kubelet
馃敼 Every node has an agent called kubelet. It ensures that the container described in PodSpecs are up and running properly.

馃敂 Kube-proxy
馃敼 kube-proxy maintains network rules on nodes.
馃敼 These network rules allow network communication to your Pods from network sessions inside or outside of your cluster.

馃敂 Container runtime
馃敼 A fundamental component that empowers Kubernetes to run containers effectively.
馃敼 It is responsible for managing the execution and lifecycle of containers within the Kubernetes environment.
馃敼 Kubernetes supports container runtimes such as containerd, CRI-O and any other implementation of the Kubernetes CRI (Container Runtime Interface).