All Products
Search
Document Center

Container Service for Kubernetes:Enable multi-cluster management

Last Updated:Jun 05, 2023

The multi-cluster management feature allows you to schedule and distribute workloads, applications, and configurations to multiple clusters by using a master instance of Distributed Cloud Container Platform for Kubernetes (ACK One). This topic describes how to enable multi-cluster management and manage master instances.

Prerequisites

An Alibaba Cloud account is created. You can enable multi-cluster management only by using Alibaba Cloud accounts.

Procedure

  1. Log on to the ACK One console. In the left-side navigation pane, choose Distributed Cloud Architecture > Multi-cluster Management.

  2. On the multi-cluster management page, specify the basic information for creating a master instance.

    Note

    More about the regions supported by multi-cluster management, see Regional availability.

    Parameter

    Description

    Region

    Select the region where the clusters that you want to manage are deployed.

    VPC

    Select a VPC for the master instance.

    vSwitch

    Select a vSwitch for the master instance.

    SLB Instance for API Server

    Default value: Standard I (slb.s2.small). You cannot change the default setting.

    Create and Associate EIP

    Specifies whether to expose the API server to external access. By default, the API server is not exposed to external access.

    Important

    If you turn on this switch, an elastic IP address (EIP) is created and associated with the internal-facing Server Load Balancer (SLB) instance of the API server. The EIP is used to expose the API server to external access. The EIP cannot be disassociated because the clusters that are associated with the master instance may use the public endpoint of the master instance.

    Enable Collection of Operation Logs and Auditing Logs

    Specifies whether to collect operation logs and audit logs. By default, this feature is enabled.

  3. Click Enable Multi-cluster Management.

    Wait a few minutes. The Multi-cluster Management page appears. If the clusters that are displayed on the page are in the Running state, the multi-cluster management feature is enabled.

Manage master instances

View information about a master instance

On the Multi-cluster Management page, click Master Instance Basic Information to view the basic information, connection information and logs about a master instance.

  • On the Basic Information tab, you can view the master instance ID, region, API server endpoint, and network information. You can click the Modify icon to the right of Master Instance Name to modify the name of the master instance.master

  • On the Connect to Master Instance tab, you can view the content of the kubeconfig files for internal access and external access. The kubeconfig files store the configurations for connecting kubectl to the master instance over the Internet and internal network.

  • On the Master Instance Logs tab, you can view the master logs.

Delete a master instance

Important

You must delete all clusters that are associated with a master instance before you can delete the master instance.

On the Master Instance Basic Information tab, click Delete Master Instance in the upper-right part to delete the current master instance.

Create a master instance

Important

After you enable the multi-cluster management feature, the system automatically creates a default master instance. If you want to create additional master instances, go to Quota Center and request a quota increase.

  1. On the Master Instance Basic Information page, click Create Master Instance.

  2. In the Create Master Instance panel, specify Master Instance Name, Region, VPC, and vSwitch.

    Parameter

    Description

    Master Instance Name

    Enter a name for the master instance.

    Region

    Select the region where the clusters that you want to manage are deployed.

    VPC

    Select a VPC for the master instance.

    vSwitch

    Select a vSwitch for the master instance.

    SLB Instance for API Server

    Default value: Standard I (slb.s2.small).

    Create and Associate EIP

    By default, this feature is disabled.

    Important

    If you turn on this switch, an EIP is created and associated with the internal-facing SLB instance of the API server. The EIP is used to expose the API server to external access. The EIP cannot be disassociated because the clusters that are associated with the master instance may use the public endpoint of the master instance.

  3. Click Create.

    Wait a few minutes. After the status of the master instance changes to Running, the master instance is created.

Switch to another master instance

On the Master Instance Basic Information page, click the expand button to the right of the master instance name and select a master instance.

switch

Use Cloud Shell to connect to a master instance

Note

Cloud Shell can connect to master instances only over the Internet. Make sure that the API server of the master instance that you want to access is exposed to external access.

Click Manage Master Instance in Cloud Shell in the upper-right part of the Master Instance Basic Information page to connect to the master instance. You can use kubectl in Cloud Shell to manage the clusters that are associated with the master instance.

Note

When you open Cloud Shell to manage a master instance, the system automatically loads the kubeconfig file of the master instance. You can use kubectl to manage the clusters that are associated with the master instance, and then follow the instructions to install the AMC command-line tool. For more information, see Use AMC.

Run the following command to query the clusters that are associated with the master instance:

kubectl amc get managedcluster

Expected output:

Name                                Alias              HubAccepted
c984b098b377f44b9a48c74fa55cf****   cluster2-beijing   true
cc36f4feb49824c9d840d9fd9cdf9****   cluster1-beijing   true