The Cloud Controller Manager (CCM) is a specialized control plane component that integrates Kubernetes with the underlying cloud provider's APIs. It was introduced to decouple the core Kubernetes code from cloud-provider-specific code, making Kubernetes more modular and easier to maintain.
Key functions of the Cloud Controller Manager:
- Node Controller:
- Checks with the cloud provider API to verify if a node has been deleted after it stops responding
- Updates node-specific cloud details like instance type, region, zones, etc.
- Route Controller:
- Configures network routes in the cloud infrastructure
- Enables pod-to-pod communication across different nodes
- Service Controller:
- Creates, updates, and deletes cloud provider load balancers when LoadBalancer-type services are created/modified/deleted
- Updates service status with load balancer details (IP addresses, hostnames)
Volume Controller (in some implementations):
- Manages cloud storage volumes (creation, attachment, mounting)
- Interacts with the cloud provider's storage APIs
Benefits of the CCM architecture:
- Modularity: Cloud providers can develop and release features without modifying the core Kubernetes code
- Maintenance: The core Kubernetes developers don't need to maintain cloud-specific code
- Flexibility: You can run Kubernetes with no CCM (for on-premises), with the built-in CCM for supported providers, or with a custom CCM
- Independence: Cloud providers can update their integrations on their own release cycles
Examples of cloud controller managers:
- AWS Cloud Controller Manager
- Azure Cloud Controller Manager
- GCP Cloud Controller Manager
- OpenStack Cloud Controller Manager
- vSphere Cloud Controller Manager
In a cloud-based Kubernetes deployment, the CCM is typically deployed as a DaemonSet or Deployment in the kube-system namespace. In self-hosted or bare-metal Kubernetes deployments, you might not use a CCM at all, or you might use a custom one for your infrastructure provider.
Before the CCM architecture, all cloud-specific code was embedded in the core Kubernetes components, which made maintenance challenging. The separation has been a significant improvement in the modularity of Kubernetes.