No history yet

Control Plane Architecture

Inside the Control Plane

The Kubernetes control plane is the brain of the cluster. It doesn't run your application containers, but it makes all the decisions about where and how they run. Think of it as the management team that ensures everything operates according to your specifications. It maintains the cluster's desired state, responding to changes and failures automatically.

This core consists of four main components working in concert: the API Server, etcd, the Scheduler, and the Controller Manager. When you issue a command with kubectl, you're kicking off a carefully choreographed sequence of events among these components.

API Server The Front Door

Every request to view or change the state of the cluster goes through the kube-apiserver. It's the central hub for all communication. When you run kubectl apply -f pod.yaml, the command is just an HTTP POST request to the API Server's REST endpoint.

The API Server's job is threefold:

  1. Authentication & Authorization: It first verifies who you are and if you have permission to make the request.
  2. Validation: It checks if the submitted YAML or JSON object is valid and conforms to the Kubernetes API schema.
  3. Persistence: If the request is valid, the API Server writes the new object's definition into the cluster's data store, etcd.

The API Server is the only component that talks directly to etcd. All other control plane components read and write state by communicating with the API Server, which enforces access control and validation.

Once the API Server validates a request and writes the object to etcd, the transaction is complete from the user's perspective. But for the cluster, the work is just beginning.

etcd The Single Source of Truth

Every piece of configuration and state for a Kubernetes cluster is stored in etcd, a consistent and highly-available key-value store. It's the definitive record of what the cluster's state should be. Deployed as a cluster of nodes itself, etcd ensures data integrity even if some of its nodes fail.

This resilience is achieved using the [{] algorithm. When the API Server writes data, a majority of etcd nodes must agree on the change before it's committed. This prevents a "split-brain" scenario where different parts of the cluster have conflicting information. All communication between the API Server and etcd is secured with mutual [{] to ensure data is encrypted and authenticated in transit.

The Scheduler Finding a Home

The kube-scheduler is a simple yet critical component. Its only job is to watch the API server for newly created Pods that have no nodeName field assigned. For every Pod it discovers, the scheduler initiates a two-step process to find the best possible home for it.

PhasePurposeExample Checks
FilteringEliminate nodes that cannot run the Pod.Does the node have enough CPU/memory? Does it satisfy the Pod's node selector or affinity rules? Does it have the required volume mounts available?
ScoringRank the remaining viable nodes.Prefers nodes with more available resources. Prioritizes nodes that already have the required container images cached. Obeys anti-affinity rules to spread Pods across nodes.

Once the highest-scoring node is identified, the scheduler doesn't deploy the Pod itself. Instead, it makes a request back to the API Server to update the Pod object, setting the nodeName field. This update, now stored in etcd, triggers the next phase of the process.

Controller Managers The Guardians

The kube-controller-manager is the component responsible for making the current state of the cluster match the desired state stored in etcd. It's not a single process, but a binary that runs several different controller loops.

Each controller specializes in a specific resource. For example, the Deployment controller watches Deployment objects and their corresponding ReplicaSets and Pods. If you declare a Deployment with 3 replicas and only 2 Pods exist, the controller sees the discrepancy and creates a new Pod to correct it. This process is called a [{] and it is the heart of Kubernetes' self-healing nature.

Other key controllers include:

  • Node Controller: Manages node status, marking them unreachable if they stop sending heartbeats.
  • Service Controller: Creates and manages the underlying load balancers for Services of type LoadBalancer in cloud environments.
  • Namespace Controller: Ensures default resources like Service Accounts are created in new namespaces.

The control plane is the brain of the Kubernetes cluster, managing its overall state and orchestrating workloads.

Now you're ready to test your understanding of how these components work together.

Quiz Questions 1/5

What is the primary role of the Kubernetes control plane?

Quiz Questions 2/5

When you issue a command like kubectl apply, which component is the first to receive and process this request?

Understanding the interactions within the control plane reveals how Kubernetes translates a simple YAML file into a running, resilient application. Each component has a distinct role, but they all rely on the API Server as the central point of communication and etcd as the single source of truth.