What is Kubernetes? And its Components

sumit sharmasumit sharma
4 min read

In the dynamic landscape of modern software development, where agility, scalability, and reliability are paramount, container orchestration has emerged as a game-changer. At the forefront of this revolution stands Kubernetes, an open-source container orchestration platform that has redefined the way applications are deployed, scaled, and managed. In this blog, we will get to know about Kubernetes and its core components

Let's Begin!

Kubernetes is an open-source container management tool used to manage containers. It eases the deployments, scaling, automation, and management of the containers. It was developed by Google and now it is maintained by CNFC (Cloud Native Computing Foundation).

POD: Pod is the smallest unit of Kubernetes. Containers are encapsulated into a Kubernetes object known as POD.

Why Kubernetes?

Allocation of resources according to the requirement is the ideal state. If the resource is less than the requirement our application can crash or if the resources are more than the requirement, then waste of resources and money. So we need a tool to manage these things for us, and Kubernetes does this for us.

Here are some key features of Kubernetes:

1. Load Balancing
2. Self-healing
3. Managing the desired state
4. Secrets management

Load Balancing: This is the key feature of the Kubernetes, It automatically creates or destroys pods as per the workload. It creates the container from the template provided at the time of creation YAML file.

Self-healing: If any pod stops working then it automatically detects, destroys the pod, and creates a new one to make the desired state.

Managing the desired state: Kubernetes also takes care of the minimum no of resources required to run any application. So it ensures the application allocates at least the desired number of resources.

Secrets management: Kubernetes also securely stores our sensitive data like passwords, OAuth tokens, keys, etc. with encryption in our cluster.

Components of Kubernetes:-

Kube-API: Kube-API is the main/primary management component of Kubernetes that manages and enables users to communicate with various components in the cluster.

The Kubernetes API serves as the communication gateway between various components within the Kubernetes system, enabling users to create, modify, and retrieve information about the resources in a cluster. This includes deploying and managing applications, scaling workloads, and querying the status of the cluster itself.

Kube-API is also responsible for authenticating and validating the request and retrieving and updating the values in the data store. Kube-API is the only component that interacts with ETCD directly.

Etcd: It is a key-value store that stores value in key-value format. It is fast secure and simple to work. In Kubernetes ETCD stores information regarding clusters such as nodes, pods, configs, secrets, and others. Every single change we made in the Kubernetes cluster stores in the ETCD data store. If the change is not stored in the ETCD data store then it is not addressed by the cluster. ETCD works on port no. 2379.

Scheduler: The Kube scheduler is a process that decides which pod goes to which node. The scheduler continuously monitors for the new pod, when a new pod is created it schedules the pod on the right node. The scheduler decides by analyzing the resource availability like the amount of free RAM, CPU, and other resources. It checks how much spaces of resources are left after placing the pod on a particular and decides whether it will place the pod on a particular node or not.

Kube controller: Kube controller is the process that monitors the state of various components and makes sure of the desired state.

Some controllers:
1. Node controller
2. Replication controller
3. Namespace controller
4. Cron Job controller
5. ReplicaSet controller
6. PV Protection controller
7. Deployment controller
8. Service account controller
9. Endpoint controller
10. Job controller etc

All controllers are packaged in one service named Kube Controller Manager.

Explaining one of the controllers is the Node controller:

Node controller: The node controller is responsible for monitoring the status of nodes and taking the necessary actions to keep the application running. It does that through the Kube-API Server.
How?
The Kube-API server checks the state of the nodes every 5sec that way node controller can monitor the health of the nodes if it stops receiving a heartbeat from the node and a node is marked unreachable, then it gives the grace period of 40sec to get reachable. After 40sec if the node is not reachable then it gives the node a comeback time of 5 minutes more, then if it does not get reachable it declares it unhealthy.

Kube Proxy: Kube proxy is the process that handles the networking or connectivity between the pods. Kube proxy maintains the networking protocols and allows networking communication within Kubernetes pods and processes or outside the world.

Kubelet: It is the captain of the ship. It is the point of contact between the master and worker node. It requests the runtime to create or destroy a pod or a container as instructed by the scheduler. It also monitors and sends the status report of the Pods and containers to Kube-API at regular intervals.

That's it for this blog for now. Hope you have got a little bit of insight into Kubernetes and its components. If you have any queries feel free to ask in the comment section.

2
Subscribe to my newsletter

Read articles from sumit sharma directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

sumit sharma
sumit sharma