Sobes.tech
Middle

What is the control plane of Kubernetes responsible for, and what do worker nodes do?

sobes.tech AI

Answer from AI

The control plane manages the cluster: it accepts commands, schedules kube-scheduler processes, manages states via kube-controller-manager, and stores configuration in etcd. Worker nodes (workers) perform actual workloads (pods) under the management of kubelet and serve network requests through kube-proxy.

Control Plane:

  • kube-apiserver: The API server of the cluster, a single entry point.
    # Example API request
    apiVersion: v1
    kind: Pod
    metadata:
      name: my-pod
    spec:
      containers:
      - name: my-container
        image: nginx
    
  • etcd: A distributed, consistent key-value store for storing cluster state.
  • kube-scheduler: Selects nodes for placing new pods.
  • kube-controller-manager: Runs controllers that monitor the cluster state and make necessary changes.
    • Node Controller
    • Replication Controller, ReplicaSet, Deployment Controller
    • Endpoints Controller
    • Service Account & Token Controllers
  • cloud-controller-manager (optional): Interacts with cloud providers to manage resources (load balancers, persistent volumes, etc.).

Worker Nodes:

  • kubelet: An agent running on each node. Manages containers in pods, interacting with container runtimes (e.g., Docker, containerd).
    # Example command that kubelet might execute (simplified)
    docker run nginx
    
  • kube-proxy: Maintains network rules on nodes, ensuring communication between pods, the cluster network, and the outside world.
  • Container Runtime: Software responsible for running containers (Docker, containerd, CRI-O).