Architecture of Kubernetes
In this blog, we will learn about the Architecture of Kubernetes, which is an important topic in the learning of Kubernetes. Most of the interviewers ask about the architecture of Kubernetes, so we should understand every component of Kubernetes.
In the previous blogs, we learn the Introduction to Kubernetes and the Installation process with some basic commands.
You can refer to my previous blogs on Kubernetes from here - Installation of Kubernetes
Components of Kubernetes Cluster
- What is a Kubernetes Cluster?
A Kubernetes cluster is a set of node machines for running containerized applications. If you’re running Kubernetes, you’re running a cluster.
The cluster is the heart of Kubernetes' key advantage: the ability to schedule and run containers across a group of machines, be they physical or virtual, on-premises or in the cloud.
Kubernetes Cluster mainly consists of Worker Machines called Nodes and a Control Plane or a Master Node.
Basic Kubernetes architecture exists in two parts: the control plane and the nodes or worker nodes.
About the Master Node
In Kubernetes, a master node is the control plane component responsible for managing the cluster. It coordinates and schedules tasks, maintains cluster state, and monitors node health. It includes components like API server, scheduler, and controller manager, ensuring overall cluster functionality and orchestration of containerized applications.
Components of the Master Node include:
Kube API server handles administrative tasks on the master node. Users send REST commands in YAML/JSON to the API server, which processes and executes them. The Kube API server acts as the front end of the Kubernetes control plane.
etcd, a distributed key-value store, maintains the cluster state and configuration details like subnets and config maps in Kubernetes’ database. It’s where Kubernetes stores its information. You can call it the brain of the Kubernetes cluster.
Kube-scheduler assigns tasks to worker nodes and manages new requests from the API Server, ensuring they are directed to healthy nodes. The kube-scheduler is responsible for scheduling Kubernetes pods on worker nodes.
Kube controller manager is a component that manages all the Kubernetes controllers. Kubernetes resources/objects like pods, namespaces, jobs, and replicas are managed by respective controllers.
Cloud Controller Manager contains a set of cloud platform-specific controllers that ensure the desired state of cloud-specific components (nodes, Load balancers, storage, etc). When Kubernetes is deployed in cloud environments, the cloud controller manager acts as a bridge between Cloud Platform APIs and the Kubernetes cluster.
About the Worker Node
Each Kubernetes cluster requires at least one worker node, which is a collection of worker machines that make up the nodes where our container will be deployed. These are the nodes where the actual work happens. Each Node can have multiple pods and pods have containers running inside them.
Components of Worker Node include:
Kubelet, an agent on each node, communicates with the master. It ensures pod containers’ health, executing tasks like deploying or destroying containers, and reporting back to the Master.
Kube-proxy enables worker node communication, and managing network rules. It ensures rules are set for containers to communicate across nodes. It performs request forwarding to the correct pods/containers across the various isolated networks in a cluster.
Container Runtime, responsible for container execution, supports multiple runtimes such as Docker, conatinerd, CRI-O. The container runtime is the software responsible for launching containers, managing their lifecycle, and providing the necessary isolation and resource constraints.
PODS - Pods are the smallest deployable units in Kubernetes, and they run on worker nodes. A pod can contain one or more containers that share the same network namespace, storage, and other resources. The container runtime (e.g., Docker) is responsible for creating and managing the containers within a pod.
kubectl - kubectl is a command-line interface (CLI) tool for interacting with Kubernetes clusters. It is the primary tool used by developers, administrators, and operators to manage and deploy applications on Kubernetes. The name "kubectl" is derived from "kube control."
So in this blog, we understood the complete architecture of Kubernetes and some other terminologies.
Do have a complete understanding of the architecture of Kubernetes and in the next blog we will learn the steps of how we can deploy a pod and deployment in the real world.
STAY TUNED FOR THE NEXT BLOG & HAPPY LEARNING !!🚀
Subscribe to my newsletter
Read articles from Yatin Gambhir directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by