Cloud Controller Manager (CCM): A quick Guide
In this blog, we will explore the Cloud Controller Manager component in Kubernetes.
What is the Cloud Controller Manager?
When Kubernetes is deployed in cloud environments, you will need access to cloud-based storage solutions to be used as pod volumes and load balancers to expose services outside the cluster.
For this, you need a component that manages all of this automatically. One critical component that acts as a bridge between cloud platforms and Kubernetes is the Cloud Controller Manager.
Cloud Controller Manager component allows Kubernetes to integrate seamlessly with cloud provider APIs, making cloud-specific resources available to your Kubernetes clusters.
The Cloud Controller Manager is responsible for connecting your Kubernetes cluster with the cloud platform's APIs.
It decouples cloud-specific logic from the core Kubernetes components. The Cloud Controller Manager ensures that Kubernetes can function independently from the cloud provider.
This abstraction allows for better flexibility, as different cloud platforms can integrate with Kubernetes using plugins or APIs.
Classic Use Cases for the Cloud Controller Manager
The Cloud Controller Manager plays an important role in automating the provisioning of cloud resources.
Here are two classic examples of how it works in action:
- Load Balancer Integration
When you create a Kubernetes Service of type LoadBalancer, the Cloud Controller Manager provisions a cloud-specific load balancer. This allows your Kubernetes service to be exposed externally, making it accessible from outside the cluster. - Storage Provisioning
The Cloud Controller Manager also helps Kubernetes provision persistent storage volumes (PV) that are backed by cloud storage solutions (such as AWS EBS, GCP Persistent Disk, or Azure Disks). When a pod requests storage via a Persistent Volume Claim (PVC), the Cloud Controller Manager communicates with the cloud provider to provision the storage and make it available to the pod.
Key Functions of the Cloud Controller Manager
The Cloud Controller Manager contains a set of cloud platform-specific controllers that ensure the desired state of cloud-specific components (such as nodes, load balancers, and storage).
Below are the three main controllers that are part of the Cloud Controller Manager:
- Node Controller: This controller updates node-related information by interacting with the cloud provider API. It manages tasks like node labeling and annotation, retrieving the hostname, CPU and memory availability, and monitoring node health.
- Route Controller: This controller is responsible for configuring network routes on a cloud platform, ensuring that pods on different nodes can communicate with each other.
- Service Controller: This controller handles deploying load balancers for Kubernetes services, assigning IP addresses, and related tasks.
Cloud Agnostic
The Cloud Controller Manager enables Kubernetes to remain cloud-agnostic. Meaning, the Cloud Controller Manager lets Kubernetes work with any cloud provider, like AWS, Google Cloud, or Azure, without being tied to one.
Each cloud provider has a separate Cloud Controller Manager project maintained by the Kubernetes community.
For example:
- AWS has its own Cloud Controller Manager that handles AWS-specific services like Elastic Load Balancers (ELB) and Elastic Block Store (EBS).
- Google Cloud has one for managing resources like Google Cloud Load Balancers and Persistent Disks.
- Azure maintains one for interacting with Azure Load Balancers and Managed Disks.