Kubernetes? What is it? The architecture?

Published by halahal.in on

Before jumping onto Kubernetes, let’s recap Docker Container, because once we are clear about Docker containers, only we can understand Kubernetes well. Refer to this article {Docker}. I’ll suggest that before going further, please refer to this article if you are not clear on Docker fundamentals.

Now that we know what Docker is, imagine if we have deployed 20 Containers running our application. If one or two containers show some errors and are killed, we can manually restart the containers with commands or Docker swarm. It is easy if the number of Containers is lower in numbers. What if these containers are 100s or 1000s in number? It will be a very cumbersome task to manage the containers manually by appointing a person or multiple persons to take care of the containers. Then it has to be some software that manages the container, its health, its up-time, restart, etc. All the management of the docker container has to be managed automatically.

Then comes the software called Kubernetes. It is an open-source software and was developed by Google for automating deployment, scaling, and management of containerized applications.


Layman’s Language = It is a Software that is used to manage the Containers.

Kubernetes Architecture:

Kubernetes consists of a cluster (multiple nodes or servers). A Kubernetes cluster consists of at least one Master (control) Node and other worker nodes. Both these components {Master and Worker} can be physical servers, Virtual Machines, or in the cloud.

Master and Worker Node

Master Node or Control Plane:

  • It is the server or node that controls the entire cluster and all the pods and containers running in it.
  • Within the Master node, there are 4 components: 1) API-Server 2) ETCD Server 3) Scheduler 4) Controller
Master and Worker Node

API-Server (Kube-API server): It exposes the Kubernetes API and it is the frontend of the Kubernetes API. It tracks the entire state of the cluster, and its components, and manages the interaction between them.

ETCD-Server (key-value store): It is the key-value store of the configuration of the entire Kubernetes cluster. It is the source of truth for the Kubernetes cluster.

Scheduler (kube-scheduler): It is the component that decides which pod should run on which node or worker node. It considers a lot of factors like Taints, Toleration, Affinity, etc. If there are no applicable nodes available for pods, it keeps them in a pending state. It continuously watches the API Server for new tasks.

Controller (kube-controller): Certain objects in the cluster are necessary and need to work properly, i.e., node-controller, deployment-controller, endpoint-controller, replica-controller, service-account controller, etc. It makes sure that all the components are in the desired state.

Worker Node:

It is the Node or server on which the pods work or the container runs. The Worker Node contains 3 components.

Worker Node Architecture

Kubelet: It is an agent that runs on each node, it is the actual component that makes sure that a pod or the container runs on the worker node. It is like a loader of a pod onto the worker node. It acts as a conduit between the API server and the node. It gets instructions from the master node and reports back to it.

Kube-Proxy: It is a network component inside of the worker node, which makes sure that the service component in the worker node gets an IP address, which can help traffic go to the corresponding pod to that service. It uses IP tables to make sure that a unique IP is assigned to all pods.

Container Runtime: It is software that is installed in all the worker nodes to run the containers (in Pods). It pulls docker images from the registry and starts and stops containers.


kubernetes
Kubernetes architecture
Categories: DevOps

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *