Skip to content
Visual explainer 3h to learn 4 steps

Control plane & node components

Explain what the API server, etcd, scheduler, controller manager and kubelet each do.

By Invicly Tech, , in Kubernetes Administrator (CKA). About 8 minutes to read.

Topic 5 of 33

In short

The control plane stores and decides cluster state, and worker nodes run Pods. The API server is the only component that talks to etcd, and every other component watches the API server. In kubeadm clusters the control plane runs as static Pods defined in /etc/kubernetes/manifests.

Explained simply

A Kubernetes cluster has a brain and a body. The brain is the control plane: it stores what you asked for and decides what should happen. The body is the worker nodes: they run your containers. The two talk only through one front door, the API server.

Picture a busy office with one reception desk. Every request, from you or from any internal team, goes through reception (the API server). Reception writes everything in one ledger (etcd). Teams like scheduling and maintenance keep checking the ledger for new work and act on it.

This design means no component gives orders directly to another. Each one watches for changes it cares about and quietly does its own job. That is why Kubernetes heals itself: if reality drifts from the ledger, some component notices and fixes it.

Press Play on a diagram to walk through it one step at a time.

LayersControl plane and nodes
  1. 1
    kube-apiserver

    Front door: authenticates, validates and stores objects.

  2. 2
    etcd

    Key-value store holding all cluster state.

  3. 3
    Scheduler and controllers

    Assign Pods to nodes; reconcile desired state.

  4. 4
    kubelet

    Node agent that runs Pods via the container runtime.

  5. 5
    kube-proxy and CNI

    Service routing rules and Pod networking.

SequenceCreating a Deployment
kubectl
API server
Controllers and scheduler
kubelet
  1. 1POST Deployment
    kubectl to API server: POST Deployment
  2. 2Persist to etcd
    API server to API server: Persist to etcd
  3. 3Controller creates ReplicaSet, Pods
    Controllers and scheduler to API server: Controller creates ReplicaSet, Pods
  4. 4Scheduler binds Pod to node
    Controllers and scheduler to API server: Scheduler binds Pod to node
  5. 5Watch sees Pod for its node
    kubelet to API server: Watch sees Pod for its node
  6. 6Start containers via CRI
    kubelet to kubelet: Start containers via CRI
  7. 7Report Pod status
    kubelet to API server: Report Pod status
FlowInside one API request
  1. 1
    Request

    kubectl sends HTTPS to port 6443

  2. 2
    Authentication

    Who is this? Cert or token

  3. 3
    Authorization

    RBAC: may they do this?

  4. 4
    Mutating admission

    Add defaults, inject fields

  5. 5
    Validating admission

    Quotas, policies, schema

  6. 6
    Store in etcd

    Then watchers are notified

MapHow each component runs on a kubeadm cluster
kubeadm cluster
  • Static Pods (control plane)
    • kube-apiserver
    • etcd
    • kube-scheduler
    • kube-controller-manager
  • systemd services (every node)
    • kubelet
    • containerd
  • DaemonSets
    • kube-proxy
    • CNI agent (Calico, Cilium)
  • Deployment
    • CoreDNS

In depth

What happens inside one API request

Every request to the API server passes the same checkpoints. Authentication works out who you are, from a client certificate, a token or another method. Authorization, usually RBAC, decides if that identity may perform this verb on this resource. Admission controllers then run: mutating ones may change the object (for example, adding a default StorageClass), and validating ones may reject it (for example, a ResourceQuota that would be exceeded).

Only after all checks pass does the API server write the object to etcd and send back a reply. A failure at each step gives a different error: 401 for authentication, 403 for authorization, and a descriptive admission error for policy problems.

  • 401 Unauthorized: unknown identity
  • 403 Forbidden: RBAC said no
  • Admission errors name the controller that refused

Watches and controllers

Components do not poll the API server over and over. They open a watch: a long-lived connection that streams every change to the resources they care about. The scheduler watches for Pods with no node. The kubelet watches for Pods assigned to its node. Each controller in kube-controller-manager watches its own kinds.

A controller runs a reconcile loop: compare desired state with actual state, then act to close the gap. The ReplicaSet controller counts Pods and creates or deletes some. The Node controller marks nodes NotReady when they stop reporting. Because loops repeat forever, a missed event is fixed on the next pass.

CycleReplicaSet controller's reconcile loop
  1. 1
    Watch

    Stream of Pod and ReplicaSet changes

  2. 2
    Count

    Pods matching the selector

  3. 3
    Compare

    Actual count vs spec.replicas

  4. 4
    Act

    Create or delete Pods to close the gap

  5. Back to step 1

Leader election and Leases

In a cluster with several control plane nodes, you get several schedulers and controller managers. If all of them acted at once they would fight. So they elect a leader using a Lease object in kube-system. Only the leader works; the others wait and take over if the leader stops renewing its lease.

Nodes also use Leases: each kubelet renews a Lease in kube-node-lease every few seconds as a cheap heartbeat. You can see these with kubectl get lease -A.

SequenceLeader election with a Lease
Scheduler A
Lease in kube-system
Scheduler B
  1. 1Acquire: A is leader
    Scheduler A to Lease in kube-system: Acquire: A is leader
  2. 2Try: held by A, so wait
    Scheduler B to Lease in kube-system: Try: held by A, so wait
  3. 3Renew regularly
    Scheduler A to Lease in kube-system: Renew regularly
  4. 4A stopped renewing: take over
    Scheduler B to Lease in kube-system: A stopped renewing: take over
  5. 5B is now leader
    Lease in kube-system to Scheduler B: B is now leader

Ports worth recognising

Port numbers show up in manifests, firewall tasks and error messages, so it helps to know the defaults.

  • 6443: kube-apiserver
  • 2379 and 2380: etcd clients and etcd peers
  • 10250: kubelet API (logs, exec)
  • 10257 and 10259: controller manager and scheduler
  • 30000 to 32767: NodePort range

Learn it in 4 short steps

About 45m each. Track them with a timer in your plan.

  1. 1
    Explain the API server and etcd~45m
  2. 2
    Explain the scheduler and controller manager~45m
  3. 3
    Explain kubelet and kube-proxy~45m
  4. 4
    Find component manifests on a node~45m

Key points

  • Only the API server reads and writes etcd.
  • The scheduler only picks a node; the kubelet actually starts containers.
  • kube-controller-manager runs many controllers, such as Deployment and Node controllers.
  • Static Pod manifests live in /etc/kubernetes/manifests on control plane nodes.
  • The kubelet runs as a systemd service, not as a Pod.

Key terms

Tap a card to flip it. 0/6 known

Examples

bash
kubectl get pods -n kube-system -o wide
ls /etc/kubernetes/manifests
# etcd.yaml  kube-apiserver.yaml
# kube-controller-manager.yaml  kube-scheduler.yaml
grep staticPodPath /var/lib/kubelet/config.yaml
systemctl status kubelet

Spotting which component is missing

You create a Deployment, but no Pods appear and no ReplicaSet exists. Step 1: the API server accepted the object, so it is up. Step 2: creating a ReplicaSet is the job of the Deployment controller inside kube-controller-manager. Step 3: check that Pod in kube-system. If ReplicaSets exist but Pods stay Pending with no events, suspect the scheduler instead.

bash
k create deploy demo --image=nginx
k get rs -l app=demo                     # nothing
k -n kube-system get pods | grep controller-manager
k -n kube-system logs kube-controller-manager-cp1 --tail=20

Reading the static Pod manifest of the API server

Step 1: on the control plane, list /etc/kubernetes/manifests. Step 2: grep the API server manifest for the flags you care about, such as the etcd address and the Service IP range. This is how you answer questions like "what is the cluster's Service CIDR" without guessing.

bash
ls /etc/kubernetes/manifests
# etcd.yaml kube-apiserver.yaml kube-controller-manager.yaml kube-scheduler.yaml
grep -E 'etcd-servers|service-cluster-ip-range' \
  /etc/kubernetes/manifests/kube-apiserver.yaml

Quick reference

  • Only kube-apiserver talks to etcd; everything else talks to the API server
  • Request order: authentication, authorization, admission, then etcd
  • Scheduler down: new Pods Pending with no scheduling events
  • Controller manager down: Deployments create no ReplicaSets or Pods
  • k get lease -n kube-system shows scheduler and controller manager leaders
  • Ports: 6443 API, 2379/2380 etcd, 10250 kubelet

Common mistakes

  • Looking for the kubelet in kube-system Pods; it is a systemd service.
  • Deleting a static mirror Pod with kubectl and expecting it to stay gone.

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1A request fails with 403 Forbidden. Which stage rejected it?

Question 2

2Which component creates the ReplicaSet when you create a Deployment?

Question 3

3How do kubelets send a cheap heartbeat to the control plane?

Question 4

4On a kubeadm cluster, how does CoreDNS run?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    List every Pod in kube-system with the node it runs on, and say which ones are static Pods.

  2. Exercise 2medium

    Find out which control plane node currently holds the scheduler leader lease.

  3. Exercise 3hard

    Write the cluster's Service CIDR and Pod CIDR to /opt/cidrs.txt using only information on the control plane node.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

Why is the kubelet not a Pod like the other components?
The kubelet is what starts Pods, including static Pods, so it has to exist before any Pod can run. That is why systemd runs it.
What happens to running apps if the control plane goes down?
Running containers keep running, because kubelets and runtimes work locally. But nothing new can be scheduled, scaled or healed until the control plane is back.
Can I talk to etcd directly to change objects?
You should not. Always go through the API server so authentication, validation and watchers all work. etcdctl is for backup, restore and health checks.

Go deeper

ShareXLinkedInWhatsApp