KAHIBARO Bookshelves
Discord Login Register

3.3. Control plane components

Overview of the Kubernetes Control Plane

In Kubernetes, the control plane is the “brain” of the cluster. It makes global decisions (scheduling, scaling, reacting to failures) and provides a consistent view of the cluster state. Worker nodes run your application containers; the control plane decides what should run where and when.

This chapter focuses on the standard, upstream Kubernetes control plane components and how they work together:

  • kube-apiserver
  • etcd
  • kube-scheduler
  • kube-controller-manager
  • cloud-controller-manager (in cloud environments)

You will later see how OpenShift builds on these ideas, but here we focus on the generic Kubernetes concepts.

kube-apiserver

kube-apiserver is the front door to the Kubernetes control plane.

Role

  • Acts as the single entry point for all operations on the cluster.
  • Exposes a REST API (the Kubernetes API).
  • Validates and processes all requests:
    • From users and automation tools (kubectl, CI/CD, etc.).
    • From other control plane components.
    • From the worker nodes.

Conceptually, the API server is the only component that talks directly to the cluster’s persistent store (etcd).

Responsibilities

  • Authentication and authorization
    • Verifies who you are (authn).
    • Checks what you are allowed to do (authz, usually via RBAC).
  • Admission control
    • Runs admission plugins (e.g., to enforce quotas, security policies, defaults).
  • Object validation
    • Ensures submitted objects (Pods, Deployments, etc.) are syntactically and semantically valid.
  • Serving and updating cluster state
    • Persists valid objects in etcd.
    • Serves current cluster state to clients via the API.
  • Watch mechanism
    • Other components subscribe (“watch”) for changes.
    • When objects change, the API server streams updates to watchers.

How other components use the API server

Other control plane components never write directly to etcd. Instead, they:

  1. Read desired and current state via the API.
  2. Compute what needs to change.
  3. Write their changes back via the API.

This pattern (read–reconcile–write via the API server) is central to how Kubernetes works.

etcd

etcd is the strongly consistent, distributed key–value store backing the Kubernetes API.

Role

  • Acts as the single source of truth for:
    • All Kubernetes objects (Pods, Deployments, Services, etc.).
    • Cluster configuration and metadata.
  • Stores the desired state of the cluster as maintained by the API server.

In production, etcd is usually run as a highly available cluster (odd number of members) to tolerate failures.

Characteristics Relevant to Kubernetes

  • Strong consistency:
    • Every successful write is guaranteed to be visible to subsequent reads.
    • Important for correctness of scheduling and controllers.
  • Watch support:
    • API server watches etcd for changes and relays them to clients.
  • Versioning and history:
    • Kubernetes objects have resource versions, enabling safe concurrency and optimistic locking.

What gets stored in etcd

Examples of data types:

  • Cluster-scoped objects: Nodes, Namespaces, ClusterRoles, etc.
  • Namespaced objects: Pods, Deployments, Services, ConfigMaps, Secrets, etc.
  • Internal configuration: API server configuration, leases, locks.

While you rarely interact with etcd directly in managed environments, its performance and reliability directly affect API responsiveness and cluster stability.

kube-scheduler

kube-scheduler assigns Pods to Nodes.

Role

  • Watches for unscheduled Pods (Pods with no Node assigned).
  • Chooses the “best” Node for each Pod according to scheduling policies.
  • Writes the scheduling decision back via the API server by setting the Pod’s spec.nodeName.

It does not start containers itself; that is the job of the node’s kubelet. The scheduler only decides placement.

Scheduling process (high level)

For each pending Pod:

  1. Filter (Predicates)
    • Eliminate Nodes that cannot run the Pod.
    • Examples:
      • Insufficient CPU / memory.
      • Node doesn’t match the Pod’s node selector or affinities.
      • Node is tainted in a way the Pod cannot tolerate.
      • Required volumes or resources aren’t available.
  2. Score (Priorities)
    • Rank the remaining Nodes.
    • Examples:
      • Prefer Nodes with more free resources.
      • Spread Pods across failure domains (zones, nodes).
      • Honor Pod affinity/anti-affinity.
  3. Bind
    • Select the highest-scoring Node.
    • Write a binding decision (or update the Pod) through the API server.

If no suitable Node exists, the Pod remains pending until conditions change (e.g., a new Node joins or resources free up).

Extensibility

The scheduler is pluggable:

  • Scheduling profiles and plugins can alter:
    • How filtering/scoring is done.
    • How scheduling decisions are made.
  • Third-party or custom schedulers can be used for specialized workloads (e.g., GPU-heavy, latency-sensitive, or batch jobs).

kube-controller-manager

kube-controller-manager runs a collection of built-in controllers that continuously reconcile different aspects of cluster state.

Reconciliation concept

Each controller implements a loop:

  1. Observe desired state from the API server (e.g., a Deployment object).
  2. Observe current state of related resources (e.g., existing Pods, ReplicaSets).
  3. Compare desired vs. current.
  4. Act: create, update, or delete Kubernetes objects so that actual state moves toward desired state.

This is often described as:

$$
\text{Reconcile loop:}\ \text{desired state} - \text{current state} \rightarrow \text{actions}
$$

Examples of built-in controllers

A few important controllers that typically run inside kube-controller-manager:

  • Node Controller
    • Monitors Node health.
    • Marks Nodes as NotReady if they stop reporting.
    • May trigger Pod eviction and rescheduling from unhealthy Nodes.
  • Replication / ReplicaSet Controller
    • Ensures the specified number of Pod replicas are running.
    • Creates or deletes Pods to match the desired replica count.
  • Deployment Controller
    • Manages rolling updates and rollbacks for Deployments.
    • Creates and manages ReplicaSets for each version of the application.
  • Namespace Controller
    • Handles cleanup when a Namespace is deleted (removes resources in that namespace).
  • Service Account & Token Controllers
    • Create default ServiceAccounts and associated credentials.
  • EndpointSlice / Service Controllers
    • Maintain network endpoint information so Services can route traffic to the correct Pods.

All of these controllers use the same pattern: watch → compare → reconcile via the API server.

cloud-controller-manager

cloud-controller-manager runs controllers that interact with the underlying cloud provider.

This component only appears in clusters integrated with cloud infrastructures (e.g., AWS, GCP, Azure, OpenStack). In on-prem or bare-metal setups, it may be absent or replaced with different integrations.

Why it exists

Originally, cloud-specific logic was deeply embedded into core Kubernetes binaries. cloud-controller-manager was introduced to:

  • Decouple cloud provider code from core Kubernetes.
  • Allow cloud providers to develop and ship their integrations independently.
  • Make Kubernetes more portable and modular.

Typical cloud-related controllers

Examples of controllers that may run in cloud-controller-manager:

  • Node Controller (cloud-specific)
    • Adds cloud-specific metadata (labels for zone, region, instance type).
    • Detects if a Node instance has been deleted at the cloud provider level.
  • Route Controller
    • Configures network routes in the cloud provider to enable inter-node networking.
  • Service Controller
    • Implements LoadBalancer Services by:
      • Creating cloud load balancers.
      • Attaching backend instances.
      • Updating Service status with external IPs/hostnames.
  • Volume Controller (in some setups)
    • Manages cloud volumes (EBS, Persistent Disks, etc.) used by PersistentVolumes.

How the Control Plane Components Work Together

To understand the interaction, consider a high-level example: creating a new Deployment.

  1. User submits a Deployment
    • A user (or CI/CD system) sends a request to kube-apiserver to create a Deployment.
    • API server:
      • Authenticates and authorizes the request.
      • Validates the object.
      • Stores it in etcd.
  2. Controllers react
    • The Deployment controller (in kube-controller-manager) watches Deployments.
    • It sees the new Deployment and creates a ReplicaSet with the desired number of replicas.
    • The ReplicaSet controller then creates the required number of Pods via the API server.
  3. Scheduler assigns Pods
    • kube-scheduler watches for Pods with no nodeName.
    • It evaluates Nodes, picks suitable ones, and writes binding decisions via the API server.
  4. Nodes run the Pods
    • Node-local components (like kubelet, described elsewhere) see the assigned Pods.
    • They pull images, start containers, and report status back to the API server.
  5. Ongoing reconciliation
    • If a Pod fails, the ReplicaSet controller notices fewer running replicas than desired and creates a replacement.
    • If a Node disappears, the Node controller marks it unhealthy; pods are eventually rescheduled by the scheduler.

Throughout this process:

  • kube-apiserver is the hub.
  • etcd is the backing store.
  • Controllers and scheduler implement control loops to drive the cluster toward the desired state.

High Availability and Scalability Considerations

In production environments, control plane components are usually run in a highly available and scalable configuration:

  • Multiple API server instances
    • Run behind a load balancer.
    • Share the same etcd cluster.
  • Etcd cluster
    • At least 3 members (often 3 or 5).
    • Deployed on separate nodes for fault tolerance.
  • Scheduler and controller-manager
    • Typically run as multiple instances, but use leader election so only one active instance of each type performs work at any time.
    • If the leader fails, another instance takes over.

This design aims to keep the cluster functional even if individual control plane nodes fail.

Summary

The Kubernetes control plane is composed of cooperative components, each with a focused responsibility:

  • kube-apiserver – central API, security, and gateway to cluster state.
  • etcd – strongly consistent store for all cluster data.
  • kube-scheduler – decides where Pods should run.
  • kube-controller-manager – runs controllers that continuously reconcile desired vs. current state.
  • cloud-controller-manager – integrates with external/cloud infrastructure where applicable.

Together, they implement Kubernetes’s declarative model: you describe the desired state, and the control plane continuously works to make the cluster match that description.

Views: 0

Comments

Please login to add a comment.

Don't have an account? Register now!

Where to Move

Move chapter:

  • ☰ 1. Course Overview
    • ☰ 1.1. What is OpenShift
      • ☰ 1.2. Why OpenShift is used in modern IT and cloud environments
        • ☰ 1.3. OpenShift vs Kubernetes
          • ☰ 1.4. Typical OpenShift use cases
            • ☰ 1.5. Structure and goals of the course
            • ☰ 2. Containers and Cloud-Native Fundamentals
              • ☰ 2.1. What is a container
                • ☰ 2.2. Containers vs virtual machines
                  • ☰ 2.3. Introduction to Docker and container images
                    • ☰ 2.4. Container registries
                      • ☰ 2.5. Basics of cloud-native applications
                      • ☰ 3. Kubernetes Fundamentals
                        • ☰ 3.1. What is Kubernetes
                          • ☰ 3.2. Kubernetes architecture
                            • ☰ 3.3. Control plane components
                              • ☰ 3.4. Worker node components
                                • ☰ 3.5. Kubernetes objects and resources
                                  • ☰ 3.6. Declarative configuration model
                                  • ☰ 4. OpenShift Architecture
                                    • ☰ 4.1. Overview of OpenShift architecture
                                      • ☰ 4.2. Control plane in OpenShift
                                        • ☰ 4.3. Nodes and machine roles
                                          • ☰ 4.4. OpenShift Operators
                                            • ☰ 4.5. OpenShift networking model
                                              • ☰ 4.6. OpenShift storage model
                                              • ☰ 5. OpenShift Installation and Deployment Models
                                                • ☰ 5.1. OpenShift deployment options
                                                  • ☰ 5.2. Installer-Provisioned Infrastructure
                                                    • ☰ 5.3. User-Provisioned Infrastructure
                                                      • ☰ 5.4. Managed OpenShift services
                                                        • ☰ 5.5. Single-node OpenShift
                                                          • ☰ 5.6. Cluster lifecycle management
                                                          • ☰ 6. Accessing and Using OpenShift
                                                            • ☰ 6.1. OpenShift web console
                                                              • ☰ 6.2. OpenShift CLI (oc)
                                                                • ☰ 6.3. Authentication and authorization
                                                                  • ☰ 6.4. Projects and namespaces
                                                                    • ☰ 6.5. Resource quotas and limits
                                                                    • ☰ 7. Building and Deploying Applications
                                                                      • ☰ 7.1. Application deployment concepts
                                                                        • ☰ 7.2. Source-to-Image (S2I)
                                                                          • ☰ 7.3. Container-based deployments
                                                                            • ☰ 7.4. DeploymentConfigs and Deployments
                                                                              • ☰ 7.5. Rolling updates and rollbacks
                                                                              • ☰ 8. Networking in OpenShift
                                                                                • ☰ 8.1. Services and service discovery
                                                                                  • ☰ 8.2. Routes and ingress
                                                                                    • ☰ 8.3. Network policies
                                                                                      • ☰ 8.4. Load balancing
                                                                                        • ☰ 8.5. External access to applications
                                                                                        • ☰ 9. Storage in OpenShift
                                                                                          • ☰ 9.1. Persistent storage concepts
                                                                                            • ☰ 9.2. Persistent Volumes
                                                                                              • ☰ 9.3. Persistent Volume Claims
                                                                                                • ☰ 9.4. StorageClasses
                                                                                                  • ☰ 9.5. Dynamic provisioning
                                                                                                    • ☰ 9.6. Stateful applications
                                                                                                    • ☰ 10. Configuration and Secrets Management
                                                                                                      • ☰ 10.1. ConfigMaps
                                                                                                        • ☰ 10.2. Secrets
                                                                                                          • ☰ 10.3. Environment variables
                                                                                                            • ☰ 10.4. Managing sensitive data
                                                                                                              • ☰ 10.5. Best practices for configuration
                                                                                                              • ☰ 11. Scaling and High Availability
                                                                                                                • ☰ 11.1. Horizontal pod autoscaling
                                                                                                                  • ☰ 11.2. Vertical scaling
                                                                                                                    • ☰ 11.3. Self-healing and pod restarts
                                                                                                                      • ☰ 11.4. High availability concepts
                                                                                                                        • ☰ 11.5. Multi-zone and multi-region clusters
                                                                                                                        • ☰ 12. Monitoring, Logging, and Observability
                                                                                                                          • ☰ 12.1. Built-in monitoring stack
                                                                                                                            • ☰ 12.2. Metrics and alerts
                                                                                                                              • ☰ 12.3. Logging architecture
                                                                                                                                • ☰ 12.4. Distributed tracing
                                                                                                                                  • ☰ 12.5. Troubleshooting applications
                                                                                                                                  • ☰ 13. Security in OpenShift
                                                                                                                                    • ☰ 13.1. Security model overview
                                                                                                                                      • ☰ 13.2. Role-Based Access Control
                                                                                                                                        • ☰ 13.3. Security Context Constraints
                                                                                                                                          • ☰ 13.4. Image security and scanning
                                                                                                                                            • ☰ 13.5. Network security
                                                                                                                                              • ☰ 13.6. Compliance and auditing
                                                                                                                                              • ☰ 14. CI/CD and DevOps with OpenShift
                                                                                                                                                • ☰ 14.1. DevOps concepts
                                                                                                                                                  • ☰ 14.2. CI/CD pipelines overview
                                                                                                                                                    • ☰ 14.3. OpenShift Pipelines (Tekton)
                                                                                                                                                      • ☰ 14.4. GitOps with Argo CD
                                                                                                                                                        • ☰ 14.5. Integrating OpenShift with external CI tools
                                                                                                                                                        • ☰ 15. Operators and Platform Services
                                                                                                                                                          • ☰ 15.1. What are Operators
                                                                                                                                                            • ☰ 15.2. Operator Lifecycle Manager
                                                                                                                                                              • ☰ 15.3. Installing and managing Operators
                                                                                                                                                                • ☰ 15.4. Common platform Operators
                                                                                                                                                                  • ☰ 15.5. Custom Operators
                                                                                                                                                                  • ☰ 16. Upgrades, Maintenance, and Operations
                                                                                                                                                                    • ☰ 16.1. OpenShift upgrade process
                                                                                                                                                                      • ☰ 16.2. Backup and restore
                                                                                                                                                                        • ☰ 16.3. Node maintenance
                                                                                                                                                                          • ☰ 16.4. Cluster troubleshooting
                                                                                                                                                                            • ☰ 16.5. Capacity planning
                                                                                                                                                                            • ☰ 17. OpenShift on HPC and Specialized Workloads
                                                                                                                                                                              • ☰ 17.1. Running batch workloads on OpenShift
                                                                                                                                                                                • ☰ 17.2. OpenShift and GPUs
                                                                                                                                                                                  • ☰ 17.3. MPI and parallel workloads in containers
                                                                                                                                                                                    • ☰ 17.4. Hybrid HPC and cloud workflows
                                                                                                                                                                                    • ☰ 18. OpenShift in Practice
                                                                                                                                                                                      • ☰ 18.1. Typical OpenShift workflows
                                                                                                                                                                                        • ☰ 18.2. Development to production lifecycle
                                                                                                                                                                                          • ☰ 18.3. Case studies from industry
                                                                                                                                                                                            • ☰ 18.4. Common pitfalls and best practices
                                                                                                                                                                                            • ☰ 19. Future Directions and Ecosystem
                                                                                                                                                                                              • ☰ 19.1. Kubernetes ecosystem overview
                                                                                                                                                                                                • ☰ 19.2. OpenShift roadmap
                                                                                                                                                                                                  • ☰ 19.3. Serverless and event-driven workloads
                                                                                                                                                                                                    • ☰ 19.4. AI and data platforms on OpenShift
                                                                                                                                                                                                    • ☰ 20. Final Project and Hands-On Exercises
                                                                                                                                                                                                      • ☰ 20.1. Deploying a containerized application
                                                                                                                                                                                                        • ☰ 20.2. Implementing CI/CD with OpenShift
                                                                                                                                                                                                          • ☰ 20.3. Securing and scaling an application
                                                                                                                                                                                                            • ☰ 20.4. Monitoring and troubleshooting report