Kubernetes is a portable, extensible, open-source platform for managing you containerized workloads and services. Kubernetes architecture takes care of scaling and failover of your applications running on a container.
In this post, you will learn about Kubernetes Control Plane Components and the Node Components and how they work together. You will learn about how a pod hosts multiple containers, how multiple pods are in a node, how several nodes are included in a cluster, and how Kubernetes uses a control plane to keep track of what is happening in a cluster.
In short, you will understand the architecture of Kubernetes.
Kubernetes architecture
A Kubernetes cluster consists of a set of worker machines, called nodes, that run containerized applications. Every cluster has one ore more worker nodes.
The node(s) host the Pods that are the components of the application workload. The pods contain one or more containers.
A control plane manages the worker nodes and the Pods in the cluster.
The following diagram shows the components managed by Kubernetes.
In production environments, the control plane usually runs across multiple computers and a cluster usually runs multiple nodes, providing fault-tolerance and high availability.
Node components in the Kubernetes architecture
Node components run on every node. The components run the pods and provide the runtime environment. There are several components that run on each node.
- kubelet. It makes sure the containers are running in a pod. You define a PodSpec and the kubelet makes sure the pods are running and healthy.
- kube-proxy. Implements part of the Kubernetes Service concept. It 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 runs the containers. The container type can beDocker, containerd, CRI-O, and any implementation of the Kubernetes CRI (Container Runtime Interface).
Control plane components in the Kubernetes architecture
The control plane’s components make global decisions about the cluster, such as scheduling, and detecting and responding to cluster events, such as starting a new pod. The control plane is a collection of components like Storage, Controller, Scheduler, API-server as follows:
- kube-apiserver. The API server is the front end for the Kubernetes control plane.
- etcd. Consistent and highly-available key value store used as Kubernetes’ backing store for all cluster data. You can think of etcd as the Kubernetes database.
- kube-scheduler. This component watches for newly created Pods with no assigned node, and selects a node for them to run on.
- kube-controller-manager. Runs the controller process, which includes
- Node controller. Notices and responds when nodes go down.
- Replication controller. Maintains the correct number of Pods.
- Endpoints controller. Populates the Endpoints, which join Services and Pods.
- Service Account & Token controllers: Create default accounts and API access tokens for new namespaces.
- cloud-controller-manager. Links your cluster into your cloud provider’s API. It separates out the components that interact with that cloud platform from components that just interact with your cluster.
Summary
In the Kubernetes architecture, there is a control plane and one or more worker nodes. The control plane communicates with worker nodes from the Kube API-server to kubelet. In the worker node, there are one or more pods that can each run one or more containers.