Importing an Alibaba Cloud cluster
Important: This content is a technical preview, and should not be relied on in a production environment.
You can import existing Alibaba Cloud clusters.
Note: By default, the multicluster-endpoint
deployment pulls all of the required images from Docker Hub. You only need to install images from DockerHub if you are working in an air gapped environment.
-
From the navigation menu, click Clusters.
-
Click Add cluster.
-
Click Import an existing cluster... > Select.
-
Provide a unique cluster name and a unique cluster namespace on the Configure cluster page.
-
Click to expand Edit cluster import YAML file and edit the file.
See Table 1. YAML file parameters and description for details about each parameter.
Note: Do not remove parameters, as the console might not properly render.
-
Click Generate Command to retrieve the command to deploy the
multicluster-endpoint
.Optional: You can add labels by clicking Configure advanced parameters and use these labels to search.
-
From the Import an existing cluster window, hover and click the Copy command icon to copy the import command and the token that you are provided. Note: You must click this icon to receive the accurate copy.
-
Go to your terminal and configure your
kubectl
for your targeted managed cluster. -
Prepare the
import.yaml
file for the Alibaba Cloud cluster.Note: If your managed Alibaba Cloud cluster cannot resolve the domain name of your IBM Cloud Pak® for Multicloud Management hub cluster, you must manually download the
import.yaml
file and change the domain name to IP from bootstrap secret.-
Paste the following command in the terminal, then modify the command to download the
import.yaml
file:curl -k -H <token> https://<mcm-hub-cluster-IP>:443/api/v1/clusters/<clustername>/<clusternamespace>/import.yaml > importAlicluster.yaml
-
Change domain name to IP from bootstrap secret. Modify the
import.yaml
file and copy the kubeconfig data fromklusterlet-bootstrap
secret section.Run the following command to decode the kubeconfig data:
echo <kubeconfig-data> | base64 -d
Change the server URL from hub cluster domain name to IP, then paste the kubeconfig into a temporary file.
Run the following command to encode your kubeconfig data:
cat <kubeconfig-temp-file> | base64 --warp=0
Replace the data of
klusterlet-bootstrap
secret with your kubeconfig data.Note: If your managed Alibaba Cloud cluster ingress type is
LoadBalancer
, you can predefine theservice type
ofwork-manager
in endpoint section. -
Add the following configuration to the
import.yaml
endpointspec
:workManager: service: type: LoadBalancer
-
-
Run the following command to deploy the
multicluster-endpoint
:kubectl apply -f <importAlicluster.yaml>
If you receive the following error, run the command again:
error: unable to recognize "STDIN": no matches for kind "Endpoint" in version "multicloud.ibm.com/v1beta1"
-
Go back to your console and click View cluster to view the Overview page and a summary of your cluster