Help Center> Multi-Cloud Container Platform> User Guide> Resource Management> Cluster Management> Adding an On-Premises Kubernetes Cluster to MCP

Adding an On-Premises Kubernetes Cluster to MCP

Prerequisites

  • An on-premises Kubernetes cluster is available. The CCE cluster is v1.13 or later, and the cluster is in the normal state.
  • The cluster can communicate with the MCP network.
  • The on-premises Kubernetes cluster to be added must have not been added to MCP.

    MCP cannot distinguish the same cluster using different access modes or different IP addresses to join an MCP instance. For example, if you have added a cluster to an MCP instance through public network and you want to add the cluster again through hub VPC, the cluster can be added but the status will be abnormal. Similar is the case when you have added a cluster to an MCP instance through a public IP address and want to add it again using another public IP address. Therefore, you are not advised to add the same cluster to MCP.

Procedure

  1. Log in to the MCP console. In the navigation pane, choose Resource Management > Cluster Management. On the page displayed, click Create Cluster.
  2. On the Create Cluster page displayed, click On-premises cluster under Private Clouds and click Next in the Select Cloud Service Provider step.
  3. Click Next and select an access mode.

    Two options are available:

    • Public network access: MCP accesses the cluster by using an EIP. Ensure that the cluster has an EIP.
    • Hub VPC: MCP connects to the hub VPC through Direct Connect to enable mutual access between the MCP and clusters. You must buy a direct connection. For details about hub VPC connections, see Network Description.
    Figure 1 Selecting an access mode

  4. Upload the KubeConfig file.

    • Upload KubeConfig File: Click Select File to upload the obtained KubeConfig file of the cluster. Ensure that the network in the configuration file is connected to the cluster. The file can be in YAML or JSON format.
      A KubeConfig file will be generated after a cluster is created. You can download the KubeConfig file from the cluster management page. For example, to download the kubeconfig file of a CCE cluster, log in to the CCE console, choose Resource Management > Clusters in the navigation pane, click the cluster name, and download the kubeconfig file on the kubectl tab page.
      Figure 2 Downloading the KubeConfig file of a CCE cluster

    • Select Context: Select a context.
    • Set Cluster Name: Set a cluster name to be used in MCP. The name must be globally unique.

  5. Click OK. The Verify Cluster Admission page is displayed.
  6. After the verification is successful, click OK to add a cluster.

    It takes about 1 minute to add a cluster. After the cluster is added, you can view the added cluster on the Cluster Management page and the cluster status is Normal.