2017-10-26 21:15:11 +00:00
---
2020-03-18 01:49:32 +00:00
title: Cloud Controller Manager
2020-05-30 19:10:23 +00:00
content_type: concept
2019-10-02 17:06:08 +00:00
weight: 40
2017-10-26 21:15:11 +00:00
---
2020-05-30 19:10:23 +00:00
<!-- overview -->
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
{{< feature-state state = "beta" for_k8s_version = "v1.11" > }}
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
Cloud infrastructure technologies let you run Kubernetes on public, private, and hybrid clouds.
Kubernetes believes in automated, API-driven infrastructure without tight coupling between
components.
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
{{< glossary_definition term_id = "cloud-controller-manager" length = "all" prepend = "The cloud-controller-manager is" > }}
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
The cloud-controller-manager is structured using a plugin
mechanism that allows different cloud providers to integrate their platforms with Kubernetes.
2017-10-26 21:15:11 +00:00
2018-06-22 18:20:04 +00:00
2020-05-30 19:10:23 +00:00
<!-- body -->
2018-06-22 18:20:04 +00:00
2017-10-26 21:15:11 +00:00
## Design
2020-03-18 01:49:32 +00:00

2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
The cloud controller manager runs in the control plane as a replicated set of processes
(usually, these are containers in Pods). Each cloud-controller-manager implements
multiple {{< glossary_tooltip text = "controllers" term_id = "controller" > }} in a single
process.
2017-10-26 21:15:11 +00:00
2018-05-05 16:00:51 +00:00
{{< note > }}
2020-03-18 01:49:32 +00:00
You can also run the cloud controller manager as a Kubernetes
{{< glossary_tooltip text = "addon" term_id = "addons" > }} rather than as part
of the control plane.
2018-05-05 16:00:51 +00:00
{{< / note > }}
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
## Cloud controller manager functions {#functions-of-the-ccm}
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
The controllers inside the cloud controller manager include:
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
### Node controller
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
The node controller is responsible for creating {{< glossary_tooltip text = "Node" term_id = "node" > }} objects
when new servers are created in your cloud infrastructure. The node controller obtains information about the
hosts running inside your tenancy with the cloud provider. The node controller performs the following functions:
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
1. Initialize a Node object for each server that the controller discovers through the cloud provider API.
2. Annotating and labelling the Node object with cloud-specific information, such as the region the node
is deployed into and the resources (CPU, memory, etc) that it has available.
3. Obtain the node's hostname and network addresses.
4. Verifying the node's health. In case a node becomes unresponsive, this controller checks with
your cloud provider's API to see if the server has been deactivated / deleted / terminated.
If the node has been deleted from the cloud, the controller deletes the Node object from your Kubernetes
cluster.
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
Some cloud provider implementations split this into a node controller and a separate node
lifecycle controller.
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
### Route controller
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
The route controller is responsible for configuring routes in the cloud
appropriately so that containers on different nodes in your Kubernetes
cluster can communicate with each other.
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
Depending on the cloud provider, the route controller might also allocate blocks
of IP addresses for the Pod network.
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
### Service controller
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
{{< glossary_tooltip text = "Services" term_id = "service" > }} integrate with cloud
infrastructure components such as managed load balancers, IP addresses, network
packet filtering, and target health checking. The service controller interacts with your
cloud provider's APIs to set up load balancers and other infrastructure components
when you declare a Service resource that requires them.
2017-10-26 21:15:11 +00:00
## Authorization
2020-03-18 01:49:32 +00:00
This section breaks down the access that the cloud controller managers requires
on various API objects, in order to perform its operations.
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
### Node controller {#authorization-node-controller}
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
The Node controller only works with Node objects. It requires full access
to read and modify Node objects.
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
`v1/Node` :
2018-05-16 06:22:29 +00:00
2017-10-26 21:15:11 +00:00
- Get
- List
- Create
- Update
- Patch
- Watch
2018-02-12 18:55:49 +00:00
- Delete
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
### Route controller {#authorization-route-controller}
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
The route controller listens to Node object creation and configures
routes appropriately. It requires Get access to Node objects.
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
`v1/Node` :
2018-05-16 06:22:29 +00:00
2017-10-26 21:15:11 +00:00
- Get
2020-03-18 01:49:32 +00:00
### Service controller {#authorization-service-controller}
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
The service controller listens to Service object Create, Update and Delete events and then configures Endpoints for those Services appropriately.
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
To access Services, it requires List, and Watch access. To update Services, it requires Patch and Update access.
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
To set up Endpoints resources for the Services, it requires access to Create, List, Get, Watch, and Update.
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
`v1/Service` :
2018-05-16 06:22:29 +00:00
2017-10-26 21:15:11 +00:00
- List
- Get
- Watch
- Patch
- Update
2020-03-18 01:49:32 +00:00
### Others {#authorization-miscellaneous}
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
The implementation of the core of the cloud controller manager requires access to create Event objects, and to ensure secure operation, it requires access to create ServiceAccounts.
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
`v1/Event` :
2018-05-16 06:22:29 +00:00
2017-10-26 21:15:11 +00:00
- Create
- Patch
- Update
2020-03-18 01:49:32 +00:00
`v1/ServiceAccount` :
2018-05-16 06:22:29 +00:00
2017-10-26 21:15:11 +00:00
- Create
2020-03-18 01:49:32 +00:00
The {{< glossary_tooltip term_id = "rbac" text = "RBAC" > }} ClusterRole for the cloud
controller manager looks like:
2017-10-26 21:15:11 +00:00
```yaml
2017-12-27 01:38:31 +00:00
apiVersion: rbac.authorization.k8s.io/v1
2017-10-26 21:15:11 +00:00
kind: ClusterRole
metadata:
name: cloud-controller-manager
rules:
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- update
- apiGroups:
- ""
resources:
- nodes
verbs:
- '*'
2017-10-31 19:50:45 +00:00
- apiGroups:
- ""
resources:
- nodes/status
verbs:
- patch
2017-10-26 21:15:11 +00:00
- apiGroups:
- ""
resources:
- services
verbs:
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- serviceaccounts
verbs:
- create
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- get
- list
- update
- watch
- apiGroups:
- ""
resources:
- endpoints
verbs:
- create
- get
- list
- watch
- update
```
2020-05-30 19:10:23 +00:00
## {{% heading "whatsnext" %}}
2020-03-18 01:49:32 +00:00
[Cloud Controller Manager Administration ](/docs/tasks/administer-cluster/running-cloud-controller/#cloud-controller-manager )
has instructions on running and managing the cloud controller manager.
2019-11-14 12:49:34 +00:00
2020-03-18 01:49:32 +00:00
Want to know how to implement your own cloud controller manager, or extend an existing project?
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
The cloud controller manager uses Go interfaces to allow implementations from any cloud to be plugged in. Specifically, it uses the `CloudProvider` interface defined in [`cloud.go` ](https://github.com/kubernetes/cloud-provider/blob/release-1.17/cloud.go#L42-L62 ) from [kubernetes/cloud-provider ](https://github.com/kubernetes/cloud-provider ).
2017-10-26 21:15:11 +00:00
2020-03-18 01:49:32 +00:00
The implementation of the shared controllers highlighted in this document (Node, Route, and Service), and some scaffolding along with the shared cloudprovider interface, is part of the Kubernetes core. Implementations specific to cloud providers are outside the core of Kubernetes and implement the `CloudProvider` interface.
2018-06-22 18:20:04 +00:00
2020-03-18 01:49:32 +00:00
For more information about developing plugins, see [Developing Cloud Controller Manager ](/docs/tasks/administer-cluster/developing-cloud-controller-manager/ ).