Kubernetes Architecture Part 2: Control Plane Components

Mark Bakker Profile Pic
Mark BakkerProduct Owner & Co-Founder
8 min read

This Kubernetes Architecture series covers the main components used in Kubernetes and provides an introduction to Kubernetes architecture. After reading these blogs, you’ll have a much deeper understanding of the main reasons for choosing Kubernetes as well as the main components that are involved when you start running applications on Kubernetes. 

This blog series covers the following topics:

This blog on Kubernetes control plane components is the second in a series of three that teaches the foundations of Kubernetes architecture. Part 1 describes the reasons for choosing Kubernetes and will help you decide if your situation is suitable for Kubernetes use. In Part 3, we go deeper into the data plane components and related concepts. As you read this blog, you will build a deeper understanding of the Kubernetes control plane, which constitutes the central nervous system of a Kubernetes cluster.  

The control plane is a collection of processes and components that are responsible for the overall management and coordination of a cluster. The control plane's components make global decisions about the cluster (for example, scheduling) and also detect and respond to cluster events (for example, starting up a new pod when a deployment's replicas field is unsatisfied). 

images-kubernetes-architecture-control-plane
An overview of basic Kubernetes architecture, highlighting the Kubernetes control plane and its relationship to the data plane, pods and other structures.

Master nodes

The master nodes run the central control plane that manages the entire cluster. They are responsible for managing and coordinating all the nodes in the cluster, scheduling and deploying applications and monitoring the state of the cluster. You typically have more than one master node in order to provide high availability. 

The master nodes typically consists of the following components: 

  1. API server: This component is the primary management component of the cluster. It provides a REST API that clients can use to interact with the cluster, and it manages the overall state of the cluster. 

  2. etcd: This component is a distributed key-value store that stores the state of the cluster, including configuration data and metadata. 

  3. Scheduler: This component is responsible for scheduling workloads on the worker nodes in the cluster. It evaluates resource requirements and available resources to determine the optimal node for a workload to run on. 

  4. Controller manager: This component is responsible for managing and monitoring the state of the cluster. It includes several controllers that monitor activity and take action to ensure that the desired state of the cluster is maintained. 

The master nodes are typically the most powerful nodes in the cluster, with high processing power and memory resources. They are usually some of the most secure nodes in the cluster, as they contain the API server and etcd, both of which store sensitive configuration data and state information. 

API server

The API server is one of the core components of the Kubernetes control plane. It runs on the master nodes in a Kubernetes cluster. The API server’s primary function is to provide a RESTful interface for managing and controlling the cluster. It provides a standard and secure way to interact with the cluster and ensures that all operations are authenticated and authorized.

Here are some of its key functions:

  1. Cluster management: The API server is the central hub for all cluster management operations. It is responsible for managing the state of the cluster and processing all incoming requests for cluster resources.

  2. Authentication and authorization: The API server provides authentication and authorization services to ensure that only authorized users and applications can access and modify the cluster resources. It also enforces security policies to ensure that resources are only accessed and modified by authorized entities.

  3. API endpoints: The API server exposes a set of RESTful API endpoints that can be used to interact with the cluster. These endpoints can be accessed using standard HTTP requests and are used by various Kubernetes components, such as the command-line tool kubectl and other Kubernetes controllers.

  4. Communication: The API server acts as the central communication point for all the other components in the control plane. It communicates with etcd to store and retrieve the state of the cluster, and it communicates with the scheduler and controller manager to manage the deployment and scaling of applications.

The API server is a critical component of the Kubernetes control plane.

Etcd

As mentioned earlier, etcd is a distributed key-value store that is used by the API server to store and manage the state of the Kubernetes cluster. Like the API server, it is a critical component of the control plane and runs on the master nodes in a cluster. 

 Here are some of the key functions of etcd:  

  1. Configuration data storage: The API server uses etcd to store configuration data and metadata about the state of the cluster. This includes information about the nodes in the cluster, the state of the applications running on the nodes and various other configuration parameters.   

  2. Distributed consensus: etcd is designed to be a distributed system, which means that it can run across multiple nodes in the cluster. This capability allows it to provide a highly available and fault-tolerant storage solution for the API server.   

  3. Scalability: etcd is designed to scale horizontally, which means that it can handle a large number of requests and can grow as the cluster grows. The ability to scale ensures that the API server can continue to operate efficiently as the cluster expands.   

  4. API server coordination: etcd is used by the API server to coordinate operations between different components of the control plane. Its role includes coordinating the deployment and scaling of applications as well as managing the state of the cluster. 

etcd provides a highly available and fault-tolerant storage solution that allows the API server to operate efficiently and ensures that the cluster can scale and grow as needed. 

Scheduler

The scheduler is a key component of the Kubernetes control plane that runs on the master nodes in a Kubernetes cluster. Its primary function is to schedule and assign workloads to run on the worker nodes in the cluster.  Here are the scheduler’s key functions: 

  1. Resource allocation: The scheduler is responsible for allocating resources on the worker nodes to ensure that workloads are properly distributed and that the nodes are not overutilized. It evaluates the resource requirements of each workload and the available resources on each node to determine the optimal placement for the workload.   

  2. Node selection: The scheduler selects the node that is best suited to run a given workload based on factors such as resource availability, node capacity and other workload requirements.   

  3. Load balancing: The scheduler ensures that workloads are evenly distributed across the worker nodes in the cluster to prevent any single node from becoming overloaded.   

  4. Rescheduling: The scheduler can also reschedule workloads in response to changes in the cluster, such as node failures or changes in workload requirements. 

The scheduler is a critical component of the Kubernetes control plane that ensures that workloads are properly distributed and that the worker nodes are utilized efficiently. By evaluating resource requirements, selecting the optimal node and load balancing across the cluster, the scheduler helps to ensure that the cluster operates smoothly. 

Kubernetes controller manager

The controller manager is a key component of the Kubernetes control plane that runs on the master nodes in a Kubernetes cluster. Its primary function is to manage various controllers that are responsible for ensuring the desired state of the cluster. 

Here are some of the most important controllers managed by the controller manager: 

  1. Node controller: The node controller is responsible for monitoring the state of the nodes in the cluster and ensuring that the desired state is maintained. It detects when a node becomes unavailable and takes action to ensure that workloads running on the node are rescheduled to other nodes in the cluster.   

  2. ReplicaSet controller: The ReplicaSet controller is responsible for ensuring that the desired number of replicas of a given workload is running in the cluster. It detects when a replica is missing or has failed and takes action to ensure that the desired number of replicas is maintained.   

  3. Deployment controller: The deployment controller is responsible for managing the lifecycle of applications in the cluster. It ensures that the desired number of replicas are running, handles rolling updates and rollbacks and scales the application up or down as needed.   

  4. Service controller: The service controller is responsible for managing the network services that are exposed by applications running in the cluster. It ensures that the services are properly configured and available, and routes traffic to the appropriate pods based on the service specifications. 

By managing various controllers that are responsible for monitoring and managing the state of the cluster, the controller manager helps ensure that the cluster operates smoothly and efficiently. 

Cloud controller manager

The cloud controller manager (CCM) is an optional Kubernetes control plane component that runs on the master nodes in a Kubernetes cluster. Its primary function is to interact with the cloud provider's APIs to manage the underlying infrastructure resources that are needed to support the cluster. 

Here are some of the key functions of the cloud controller manager:  

  1. Node management: The CCM manages the lifecycle of nodes in the cluster, including creating new nodes, deleting nodes and scaling the number of nodes up or down based on demand. It interacts with the cloud provider's API to provision and manage the underlying infrastructure resources needed to support the nodes.   

  2. Load balancer management: The CCM manages the creation and configuration of load balancers that are used to distribute traffic to applications running in the cluster. It interacts with the cloud provider's API to create and configure load balancers, and it ensures that they are properly integrated with the Kubernetes Service API.   

  3. Volume management: The CCM manages the creation and configuration of storage volumes that are used by applications running in the cluster. It interacts with the cloud provider's API to create and manage the underlying storage resources needed to support the volumes, and it ensures that the volumes are properly integrated with the Kubernetes API.   

  4. Networking: The CCM manages the networking resources that are needed to support the cluster, including virtual private networks, subnets and network security groups. It interacts with the cloud provider's API to create and manage these resources, and ensures that they are properly configured to support the Kubernetes network model. 

The Cloud Controller Manager helps to manage the underlying infrastructure resources needed to support the cluster. By interacting with the cloud provider's APIs, it ensures that the cluster is properly provisioned, configured, and integrated with the cloud infrastructure. 

Summary

The Kubernetes control plane is the central nervous system of a Kubernetes cluster It is a collection of processes and components that are responsible for the overall management and coordination of the cluster, and it is essential for proper functioning of the cluster. 

The control plane includes the Kubernetes API server, which is the central point of communication between all the components in the cluster. It also includes the etcd distributed key-value store, which stores the configuration data for the cluster, and the scheduler, which is responsible for deciding which nodes in the cluster should run which workloads. 

The control plane also includes other components such as the controller manager and the cloud controller manager, which help to manage the state of the cluster and ensure that it is running smoothly. 

About StackState

Designed to help engineers of all skill levels who build and support Kubernetes-based applications, StackState provides the most effective solution available for Kubernetes troubleshooting. Our unique approach to SaaS observability helps teams quickly detect and remediate issues so they can ensure optimal system performance and reliability for their customers. With StackState’s comprehensive observability data, the most complete dependency map available, out-of-the-box applied knowledge and step-by-step troubleshooting guidance, any engineer can remediate issues accurately and with less toil. 

As a company dedicated to helping teams succeed with Kubernetes, we want to provide useful information in as many related areas as we can. We hope this tutorial proves to be helpful for your team.  

  • If you want to play around with StackState yourself, our playground is just a click away.   

  • And when it’s time to set your focus on Kubernetes troubleshooting, sign up for a free trial to see how simple it can be.