Kubernetes Architecture
Kamalpreet Singh
Senior System Engineer at Infosys | AWS certified cloud Practitioner| DevOps Engineer | AWS | Site Reliability Engineer | Linux | Jenkins | Kubernetes | Git | Terraform | Docker
Hi Folks,
Kubernetes is known as the Container Orchestration Tool. In this article, I will be explaining K8S architecture in detail.
K8S is a bit complicated to understand But after going through various courses like TrainWithShubham , Imran Teli , and Technical Guftgu I have created this document.
In a Cluster, there can be n number of Nodes. In a Node there can be n number of PODS, inside POD there can be n number of containers but usually, only a single container is preferred inside a POD. Inside the container, there are Microservices.
In the above Diagram on the left-hand side, it's a Master (Control Plane) and on the right-hand side, there are two nodes (Node1 and Node2). There can be any number of nodes but we have used just 2 nodes in the diagram attached above.
In the Master(Control plane) Kube API server is the main representative with which the Admin/user deals. API-server has access to the etcd cluster. The Kube API server has access to scale automatically as per the load. A control Manager is used for making a balance between the actual state and the desired state. This means it handles the requests and approvals. If Kubernetes is on the cloud then it will use cloud controller manager. If the Kubernetes is not on the cloud then it will use Kube controller manager. The Kube scheduler is further used to make the actual state equal to the desired state. Kube scheduler takes action for the approvals provided by the Control manager. Kube Scheduler handles pod creation and maintenance. The scheduler checks the newly created PODs that have no node assigned, for every POD the scheduler discovers it becomes responsible for finding the best node for that pod to run on. The etcd Cluster is a database that stores metadata and the state of the cluster. etcd is consistent and highly available. the etcd cluster is very fast. It benchmarked 10000 writes per second. The etcd Cluster is fully replicated. The entire state is present in each node in the cluster.
领英推荐
In simple words, we can say that the API server is the front face. The etcd Cluster is the database of the Master(Control plane). Kube scheduler takes action for the change. The control manager examines and determines whether change is required or not.
On the right-hand side, there can be any number of nodes based on the requirement.
Kubeproxy is used to assign the IP address to POD. (Container does not have an IP address it used the IP address of the POD. That's the reason only a single container is preferred inside the POD.)
Kubeproxy runs on each node and this makes sure that each pod will get its own unique IP address.
POD is the basic or we can say the Atomic unit of Kubernetes. Inside the POD, Containers are created. POD is a group of one or more containers that are deployed on the same Host. In Kubernetes, the control unit is a pod, not a container. It contains one or more tightly packed containers. Kubernetes only knows about POD, not about the container. The container cannot be started without the POD.
Kubelet listens to Master and uses port 10255. It sends a success/fail report to the master. It can be considered as an agent running on the Node. Kubelet helps to start/stop the container. It also helps to expose containers on ports that are specified in the manifest file.