A kubernetes cluster contains master nodes and few worker nodes.
Worker nodes hosts the containers/pods and master nodes distributes the workloads to the worker nodes.
To achieve this behavior several components needs to be installed in Master nodes and Worker Nodes.
Components in Master Node:
- apiserver: Api server is used to establish any communication with the kubernetes cluster through REST APIs. Any input to kuberenets cluster is received in JSONs.
- Cluster storage: Its used to store all configuratons and state information of the cluster. It uses etcd to store the data. apiserver will connect with cluster store to fetch these informations.
- Kube Contoller manager- It runs in infinite loop and watches for any changes in the cluster. Status is collected and shared with apiserver thus ensuring apiserver has the latest status. Each component in the cluster has a separate controller. Eg: Node, Endpoint, Namespace etc.
- Kube scheduler - It watches apiserver for any new pods and schedules them in the available nodes.
Components in Worker Nodes:
- Kubelet: It's an agent deployed in worker nodes and communicates with master node through apiserver. Kubelet instantiates pods in the nodes. Any nodes to be added to cluster requires kubelet to be setup.
- Container Engine: Container engine is used for Container management like pulling images and starting and stopping containers. 3.Kube Proxy: Kube-proxy handles all networking requirements including load balancing across all pods, POD IP addresses.