Kubernetes is an open-source platform for deploying and managing containers. Kubernetes architecture follows a distributed model, comprising multiple components working together to ensure the seamless execution of containerized applications. At the core of this architecture lies the master node, responsible for managing the entire cluster and orchestrating the operations across worker nodes.
In this blog, we are going to cover the Kubernetes Cluster architecture, Kubernetes components, Managed Kubernetes Services. Also, we will be discussing the Kubernetes master node & worker node and their components.
What Is Kubernetes?
In organizations, multiple numbers of containers run on multiple hosts at a time. So it becomes very hard to manage all the containers together, a simple solution to this would be Kubernetes. Kubernetes is an open-source platform for managing containerized workloads and services. Kubernetes take care of scaling and failover for our application running on the container.
Read More : Kubernetes for beginners
What is Kubernetes Architecture?
Kubernetes provides a flexible architecture for discovering services within a cluster while maintaining loose connections. A Kubernetes cluster comprises a set of control planes and compute nodes. The primary role of the control plane is to oversee the entire cluster, expose the API, and manage the scheduling of compute nodes according to the desired settings. The compute nodes run container runtimes such as Docker, alongside a communication agent called kubelet, which interacts with the control plane. These nodes can consist of physical servers, virtual machines (VMs) in on-premises or cloud environments.
1) In the Kubernetes architecture diagram above you can see, there is one master and multiple nodes.
2) The Master node communicates with Worker nodes using Kube API-server to kubelet communication.
3) In the Worker node, there can be one or more pods and pods can contain one or more containers.
4) Containers can be deployed using the image also can be deployed externally by the user.
Read more about Kubernetes Network Policy here.
Kubernetes Architecture Components
Read more about Container Orchestration and Management Options
Kubernetes Master Node
In Kubernetes (k8s), 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.
Master Node Components:
1) 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.
2) 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.
Read More: Kubernetes for Testers.
3) Kube-scheduler assigns tasks to worker nodes and manages new requests from the API Server, ensuring they are directed to healthy nodes.
4) Kube Controller Manager task is to retrieve the desired state from the API Server. If the desired state does not match the current state of the object, corrective steps are taken by the control loop to align the current state with the desired state.
There are different types of control manager in Kubernetes architecture:
- Node Manager: It oversees nodes, creating new ones in case of unavailability or destruction.
- Replication Controller: It ensures the desired container count is maintained within the replication group.
- Endpoints Controller: This controller populates the endpoints object, connecting Services & Pods.
Also read: Difference between Kubernetes vs Docker.
Kubernetes Worker Node
Worker nodes in a cluster are machines or servers running applications, controlled by the Kubernetes master. Multiple nodes connect to the master. On each node, multiple pods and containers operate.
Components of Worker Nodes:
1) Kubelet, an agent on each node, communicates with the master. It ensures pod containers’ health, executing tasks like deploying or destroying containers, reporting back to the Master.
2) Kube-proxy enables worker node communication, managing network rules. It ensures rules are set for containers to communicate across nodes.
3) A Kubernetes pod is a set of containers on a single host, sharing storage and network. It includes specifications for container execution, enabling easy inter-container communication.
4) Container Runtime, responsible for container execution, supports multiple runtimes: Docker, containers.
Also read: Our blog on Kubernetes Networking Services
In summary, the different parts of Kubernetes architecture collaborate effectively to build a strong platform for managing applications in containers. By grasping how these core elements work together, you can smoothly handle tasks like deploying, scaling, and managing applications. With this knowledge, you can make the most of Kubernetes and confidently manage applications with ease.
Frequently Asked Questions
What is Kubernetes (K8s)?
Kubernetes, commonly referred to as K8s, is an open-source container orchestration platform. It automates the deployment, scaling, and management of containerized applications. Kubernetes provides a framework for running and coordinating containers across a cluster of nodes.
What is the role of the API server in Kubernetes architecture?
The API server is a key component of the Kubernetes control plane. It exposes the Kubernetes API, which allows users and other components to interact with the cluster. The API server handles requests for creating, modifying, and deleting Kubernetes objects such as pods, services, and deployments. It validates and processes these requests, enforces authentication and authorization policies, and stores the cluster state in etcd.
What is etcd in Kubernetes?
etcd is a distributed key-value store that is used as the primary data store for Kubernetes. It stores the configuration data, cluster state, and metadata about Kubernetes objects. The master node and other components interact with etcd to read and write the desired state of the cluster. etcd ensures data consistency and provides a reliable source of truth for the cluster.
What is the role of the kubelet in Kubernetes architecture?
The kubelet is an agent that runs on each worker node in the cluster. It is responsible for managing and maintaining the state of pods on the node. The kubelet communicates with the API server to receive pod definitions and ensures that the specified containers are running and healthy. It monitors the health of pods, starts and stops containers as necessary, and reports the status back to the API server.
How does Kubernetes handle pod scheduling?
Kubernetes uses a component called the scheduler to handle pod scheduling. The scheduler assigns pods to worker nodes based on resource requirements, node availability, and other constraints. It takes into account factors like CPU and memory
Related Post
- [Part 1] Docker vs Virtual Machine | Physical vs Virtual Servers
- [Part 2] Docker Architecture | Docker Engine Components | Container Lifecycle
- Certified Kubernetes Administrator (CKA) Certification Exam: Everything You Must Know
- Certified Kubernetes Administrator (CKA) Certification: Step By Step Activity Guides/Hands-On Lab Exercise
- For Kubernetes Components Documentation, click here
Join FREE Masterclass
Discover the Power of Kubernetes, Docker & DevOps – Join Our Free Masterclass. Unlock the secrets of Kubernetes, Docker, and DevOps in our exclusive, no-cost masterclass. Take the first step towards building highly sought-after skills and securing lucrative job opportunities. Click on the below image to Register Our FREE Masterclass Now!
Leave a Reply