Kubernetes is built with three main components, Master, Node, and Addons, what is it in details. Let’s take a look at this tutorial,
First of all, about the Master component.
This component can be considered as the heart of Kubernetes, built to manage all operations, manipulations with containers in the cluster. It includes API Server (kube-apiserver), etcd, Scheduler (kube-scheduler), Controller Manager (kube-controller-manager) and Cloud Controller Manager (cloud-controller-manager).
API Server provides RESTful APIs for other components in Kubernetes Master. We can get information about a resource in Kubernetes, track their changes or create a new resource using these APIs. The API Server stores information about Kubenetes objects into etcd.
etcd as a distributed, open source system, used to store key-value values. Kubernetes uses etcd to save, update and duplicate its data.
The scheduler is responsible for determining which node in the cluster can be used to run pods.
Controller Manager is a set of control loops that observe changes from API Server to make sure that the cluster is always in the state it desires.
Cloud Controller Manager is used to interact with the Cloud Provider.
Next is the Node component.
The Node component is built to run on all nodes of the Kubenetes cluster, responsible for managing and reporting the status of the Pods for Kubernetes Master.
In order to do this, in each node, we will have an agent named kubelet, responsible for managing and reporting of node activity to API Server của Kubernetes. The kubelet will run containers using runtime containers like Docker. It will not manage containers that are not created by Kubernetes.
Another component in the node is the kube-proxy, which acts as the routing between the service and the pods.
At each node, we will also have Container Runtime taking care of run the containers. Kubernetes supports several runtime containers such as Docker, rkt, …
Kubernetes’s last component are Addons.
This component is pods and services that perform the functions of a cluster like DNS Server, Web UI (Dashboard) supports manage Kubernetes cluster by UI, Container Resource Monitoring (record system information into the database and allow us to analyze that information using UI) and Cluster-level Logging (save log of containers then we can see their log information).
The correlation between the Kubernetes Master and Kubernetes Node can be shown in the following figure:
When we execute a command using the kubectl tool, it means that kubectl will send a request to the API Server, API Server will be responsible for the response to kubectl, it will push and pull the information from etcd. Depending on the request, for example, if you want to run a pod, the scheduler will be responsible for determining which node will perform this request. Controller Manager will monitor the task and report if any problems occur. API Server will retrieve the log from the pods through the kubelet.