We earn commission when you buy through affiliate links.
This does not influence our reviews or recommendations.Learn more.
Lets learn Kubernetes architecture in detail.
I assume you have a basic understanding of Kubernetes.
If not, check out the following introduction and installation articles.
https://geekflare.com/kubernetes-for-beginners/
Kubernetesfollows master-slave architecture.
Kubernetes architecture has a master node and worker nodes.
There are four components of amaster node.
And, theworker nodehas three components.
you might talk to the master node via the CLI, GUI, or API.
For achieving fault tolerance, there can be more than one master node in the cluster.
All the other master nodes would be the followers of that leader master node.
Also, to manage the cluster state, Kubernetes uses etcd.
All the master nodes connect to etcd, which is a distributed key-value store.
Let me explain to you about all these components one by one.
API Server
API Server performs all the administrative tasks on the master node.
etcd saves the resulting state of the cluster as a distributed key-value store.
Scheduler
After that, we have a scheduler.
So as the name suggests, the scheduler schedules the work to different worker nodes.
It has the resource usage information for each worker node.
The scheduler also considers the quality of service requirements, data locality, and many other such parameters.
Then the scheduler schedules the work in terms of pods and services.
So, the controller manager makes sure that your current state is the same as the desired state.
etcd
The etcd is a distributed key-value store that is used to store the cluster state.
etcd is written in the goLang, and it is based on theRaft consensusalgorithm.
Even if some of the members fail to work, this algorithm can still work at any given time.
There can be only one master, and all the other masters have to follow that master.
The pods are scheduled on the worker nodes, which have the necessary tools to run and connect them.
Pods are nothing but a collection of containers.
Lets explore the worker node components.
Some examples of container runtimes that I can give you are the containers rkt, lxc, etc.
So, if you have ten worker nodes, then kubelet runs on each worker node.
It receives the pod definition by various means and runs the containers associated with that port.
It also makes sure that the containers which are part of the pods are always healthy.
The kubelet connects to the container runtime using gRPC framework.
The kubelet connects to the container runtime interface (CRI) to perform containers and image operations.
These two services have two different operations to perform.
Docker shim and CRI containers are two examples of CRI shim.
It listens to the API server for each service point creation or deletion.
For each service point, kube-proxy sets the routes so that it can reach to it.
Conclusion
I hope this helps you to understand Kubernetes architecture in a better way.