The cloud controller manager (CCM) can integrate Kubernetes with basic services of Alibaba Cloud, such as Classic Load Balancer (CLB). This topic describes how to install and use the CCM in a registered cluster.
Prerequisites
A registered cluster is created. For more information, see Create a registered cluster.
A kubectl client is connected to the registered cluster. For more information, see Obtain the kubeconfig file of a cluster and use kubectl to connect to the cluster.
Features
Manage CLB instances
If you set Type=LoadBalancer
for a Service, the CCM automatically creates a CLB instance for the Service, and configures listeners and vServer groups. When the CCM identifies endpoint changes in the vServer groups associated with a Service or cluster node changes, the CCM automatically updates the vServer groups.
The CLB vServer groups in this topic refer to nodes on Alibaba Cloud.
Install and use the CCM
onectl CLI
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:
onectl addon install cloud-controller-manager
Expected output:
Addon cloud-controller-manager, version **** installed.
ACK console
Log on to the ACK console. In the left-side navigation pane, click Clusters.
On the Clusters page, find the cluster that you want to manage and click its name. In the left-side pane, choose .
On the Secrets page, click Create from YAML. Fill in the following sample code to create a Secret named alibaba-addon-secret.
NoteComponents access cloud services using the stored AccessKeyID and AccessKeySecret. Skip this step If an
alibaba-addon-secret
already exists.apiVersion: v1 kind: Secret metadata: name: alibaba-addon-secret namespace: kube-system type: Opaque stringData: access-key-id: <AccessKeyID of the RAM user> access-key-secret: <AccessKeySecret of the RAM user>
In the left-side navigation pane, choose
.On the Add-ons page, find the Cloud Controller Manager card, and click Install in the lower-right part of the card.
After the CCM is installed, you can use the CCM in the following ways.
The CCM automatically creates CLB instances for Services, and configures listeners and vServer groups. For more information, see Considerations for configuring a LoadBalancer type Service.
The CCM allows you to add annotations to Service configurations to customize load balancing. For more information, see Add annotations to the YAML file of a Service to configure CLB instances.