Cloud Controller Manager (CCM) provides Kubernetes with the ability to integrate with Alibaba Cloud products, such as Server Load Balancer (CLB). This topic describes how to deploy and use CCM in registered clusters.
Prerequisites
-
You have connected to a registered cluster. For more information, see Create an ACK One Registered Cluster.
-
You have connected to a registered cluster using kubectl. For more information, see Obtain Cluster KubeConfig and Connect to a Cluster by Using kubectl.
Function Introduction
Manage Load Balancing
When you set the Service type to Type=LoadBalancer, the CCM component creates or configures an Alibaba Cloud Server Load Balancer (CLB) for the Service. This includes resources such as the CLB, listeners, and backend server groups. When the backend Endpoint of the Service or the cluster node changes, CCM automatically updates the backend virtual nodes of the CLB.
The CLB backend here only includes cloud nodes.
Deploy and Use
Install by Using onectl
Install onectl on your on-premises machine. For more information, see Use onectl to manage registered clusters.
-
Run the following command to install the CCM component.
onectl addon install cloud-controller-managerExpected output:
Addon cloud-controller-manager, version **** installed.
Install by Using the Console
Log on to the ACK console. In the left navigation pane, click Clusters.
On the Clusters page, click the name of your cluster. In the left navigation pane, click .
On the Secrets page, click Create from YAML. Enter the following content to create a secret named alibaba-addon-secret.
NoteThe component uses the AccessKey ID and AccessKey secret stored in this secret to access cloud services. If the alibaba-addon-secret secret already exists, you can skip this step.
apiVersion: v1 kind: Secret metadata: name: alibaba-addon-secret namespace: kube-system type: Opaque stringData: access-key-id: <The AccessKey ID of the RAM user> access-key-secret: <The AccessKey secret of the RAM user>-
In the navigation pane on the left, choose .
-
On the Add-ons page, find the Cloud Controller Manager managed component and click Install in the lower-right corner of the card.
After the component is installed, use the CCM component as follows.
-
The CCM component creates or configures an Alibaba Cloud Server Load Balancer (CLB) for the Service. This includes resources such as the CLB, listeners, and backend server groups. For more information, see Considerations for Service Load Balancer Configuration.
-
The CCM component provides many annotations that support rich load balancing capabilities in the cloud. For detailed usage, see Configure Classic Load Balancer (CLB) by Using Annotations.