Master Node
The Master node is the control center of the Kubernetes cluster, responsible for managing the cluster’s state, scheduling applications, handling cluster events, and monitoring the cluster’s health. The Master node typically includes the following core components:
-
API Server (kube-apiserver): Acts as the frontend interface for the Kubernetes cluster. All management operations are conducted through the API Server. It receives and processes requests from users, command-line tools, and other components, forwarding them to the appropriate component for handling.
-
Scheduler (kube-scheduler): Responsible for scheduling Pods to available Worker nodes based on the application’s resource requirements and the cluster’s state. The scheduler selects the optimal node to run a Pod according to predefined scheduling policies.
-
Controller Manager (kube-controller-manager): Contains multiple controllers that maintain the cluster’s desired state. Common controllers include the Replication Controller, Namespace Controller, Node Controller, etc. These controllers ensure that various resources in the cluster are in the expected state.
-
etcd: A distributed key-value store used to store the configuration and state information of the Kubernetes cluster. As the data storage backend of the Master node, etcd provides persistent storage and high availability.
Worker Node
Worker nodes are the workhorses of the Kubernetes cluster, responsible for running the container instances of applications. Each Worker node runs a program called kubelet, which communicates with the Master node and manages the lifecycle of Pods on the node. Additionally, Worker nodes include the following core components:
-
kubelet: An agent running on each Worker node, responsible for receiving Pod creation requests from the API Server and ensuring that the Pods are running. It manages the containers on the node, including creation, start, stop operations, and interacts with the Master node to obtain Pod scheduling information. kubelet also monitors the containers on the node and reports their status to the Master node.
-
Kube-proxy: Provides network proxy and load balancing services for Pods. It maintains the network rules in the cluster and routes requests to the correct Pods.
-
Container Runtime: Responsible for running containers on the Worker node. Common container runtimes include Docker, containerd, etc. These runtimes manage the lifecycle of containers, their file systems, and network configurations.