Use CCM in Registered Clusters

更新时间:
复制 MD 格式

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

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.

Note

The CLB backend here only includes cloud nodes.

Deploy and Use

Install by Using onectl

  1. Install onectl on your on-premises machine. For more information, see Use onectl to manage registered clusters.

  2. Run the following command to install the CCM component.

    onectl addon install cloud-controller-manager

    Expected output:

    Addon cloud-controller-manager, version **** installed.

Install by Using the Console

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Configurations > Secrets.

  3. On the Secrets page, click Create from YAML. Enter the following content to create a secret named alibaba-addon-secret.

    Note

    The 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>
  4. In the navigation pane on the left, choose Operations > Add-ons.

  5. 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.