Kubernetes is one of the most popular DevOps tools used to manage the containerization of applications. With the need for applications with several containers rising, the need for a complex tool that can handle all that is also at its peak. Here, Kubernetes is used to manage such complex containers and develop cloud-native applications. To understand the entire scenario of how Kubernetes does all of this complex process, we must learn about the architecture of Kubernetes. So, in this Kubernetes Architecture article, you will learn everything you need to know about the components of Kubernetes and its architecture.
The topics covered in the articles are:
Kubernetes is an orchestration tool used to manage containerized applications or microservices across a node cluster. It is an open-source DevOps tool that provides incredible features like self-healing of containers and automatic rollback.
Here “orchestration tool'' refers to the tool that enables the management of applications. And, there can be several processes while managing an application like deployment, scaling up and down, rolling updates etc.
Then, when we say “containerized application” we refer to the applications that can run in a container, which means the encapsulation of application code software and relevant files, libraries etc to form a single package.
Now, moving forward before you get to learn the Components and Architecture of Kubernetes, first, let’s have a walk through some common and important Kubernetes terms.
Become a Kubernetes Certified professional by learning this Kubernetes Training!
When an application is packed as a single unit with its software code and other dependencies like libraries and other files, it is called a container. This packaging enables the smooth and fast running of the containerized application.
Controllers are those that monitor or control the state of the cluster, trying to achieve a desired cluster state from the present state.
Daemon Set is a feature that ensures that your pods (some or all) are running on the nodes in a cluster. It is their work to create pods when a new node is created and when the node is deleted, garbage collects pods.
When one or more containers are controlled as a single unit it is referred to as a pod. And, this pod contains a lot of things in it like storage resources, application containers, network ID, and other things to run containers.
Service is an abstraction to define a group of pods and other rules to access those pods.
As the name suggests, volume refers to the container volume. It is somewhat similar to a Docker container but here the volume refers to the volume of an entire pod. The volume doesn’t go anywhere, all the information or data stays in the containers unless the pod is destroyed.
The namespace is a virtual cluster that is used for the isolation of concerns. It helps in an environment where there are several users across several verticals and all of them have their respective concerns.
Kubernetes works on a client-server architecture. By default, there is a single master server acting as a point of contact and a controlling node. There are several components that complete the client-server architecture.
The architecture has two major parts -
The master node consists of a Kube-apiserver, a Kube-controller-manager, an etcd storage, a cloud-controller-manager, a DNS server for Kubernetes services, and a Kube-scheduler.
Worker Node which consists of kubelet and Kube-proxy mounted on Docker.
Now, let’s go on to understand each part of the Kubernetes Architecture one after the other with the help of the following diagram.
First, let’s begin with understanding the Master Node.
If you want to Explore more about Kubernetes? then read our updated article - KubernetesTutorial!
Etcd Cluster stores all the Kubernetes configuration data, namespace, service discovery details, and API objects. This data can be accessed only by the Kubernetes API server considering its sensitivity. Also, notifications are enabled to the cluster by etcd related to the changes in configuration.
API Server is the central region in the Master Node. All the operations that are on the cluster are provided by the Kubernetes API Server. It enables rapid communication between different libraries and tools. Also, it can be seen in the diagram that API Server is the only component in the Kubernetes Architecture that can communicate with the etcd cluster, as it makes sure that the data is stored concerning all the service details in the etcd cluster.
The controller manager as the name suggests is responsible for running all the controlling processes in the background. Here, controlling processes refer to the processes like replication controller, endpoints controller, service account controller, and namespace controller. This enables the regulation of the cluster’s shared state and performance of routine tasks. If any change takes place in the service configuration, the controller manager becomes active and starts working in the direction to achieve whatever is desired. There are different controllers run by the controller manager to handle endpoints, nodes, etc.
The scheduler is another important component in the Kubernetes Architecture that distributes the workload. First, it tracks how well is the workload being utilized on cluster nodes and after that it begins to schedule or distribute the workload on the available nodes. The main work can be defined as the distribution of pods to the available nodes. This enables the good utilization of workload and new pod allocations.
After the Master Node comes to the Node Components
The first and the foremost thing that is needed in every node is Docker. It enables the running of encapsulated containers in an isolated environment.
Kubelet is the service in the Node Components that is directly connected to the Kubernetes API Server. It receives pod modifications (new or old) from the API Server and ensures if they are running in their desired state. Also, Kubelet reports about the host’s health to the master and looks at and manages port forwarding and network rules.
Since Kubernetes Proxy Service is a proxy service its main task is to make relevant services available to the external host. This proxy runs on each node and takes care of forwarding the requests to the correct containers. It looks after the complete networking environment, i.e. it is accessible, predictable yet isolated.
There’s one more component in the Kubernetes Architecture just outside the Master Node, called the Kubectl.
Kubectl is a command-line tool provided by Kubernetes to communicate with Kube-apiserver and send commands converted to API to the master node.
This was all in the Kubernetes Architecture.
Top 30 frequently asked Kubernetes Interview Questions!
Conclusion
By now, you would be well versed with Kubernetes Architecture. In the beginning, you learned the basics of Kubernetes and then moved further to strengthen those basics. You made a firmer grip over some commonly used terms in Kubernetes like Controller, Container, Daemon Set, Volume, etc.
Furthermore, after you were done with some commonly used terms, you moved to the main topic - Kubernetes Architecture. In the latter, you saw how there are two major nodes and what all it constitutes of. By the end, you knew all about the flow in Kubernetes Architecture.
Related Articles:
Batch starts on 8th Jun 2023, Weekday batch
Batch starts on 12th Jun 2023, Weekday batch
Batch starts on 16th Jun 2023, Fast Track batch