After you install IBM Multicloud Manager, you are ready to import a cluster to manage.
You must have an IBM Multicloud Manager hub that is deployed and cluster that you want to manage.
You need to install the Kubernetes CLI, kubectl. To install kubectl, see Installing the Kubernetes CLI (kubectl).
You must install the IBM Cloud Private CLI, cloudctl. For more information, see Installing the IBM Cloud Private CLI to install the CLI.
Note: Download the installation file for CLI tools from the management console.
You need a target cluster that you want to import and manage.
Important: You cannot import a hub cluster as a managed cluster.
For an air-gapped environment: There are additional steps that are required for importing a cluster that you must complete before you import the cluster with the CLI. For more information, see Importing a managed cluster in an air gapped environment.
To learn more about the import command and see [options] that are available, see IBM Cloud Private CLI multicluster commands (mc).
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.
Log in to your hub-cluster with cloudctl login. Run the following command:
cloudctl login -a https://<Hub Cluster Master Host>:<Cluster Master API Port> --skip-ssl-validation
Run the following command to create the configuration template, cluster-import-config.yaml, where <name> is the name of the cluster resource on the hub, and <namespace> is the namespace of the cluster
resources on the hub:
cloudctl mc cluster template {name} [-n|--namespace {namespace}] > cluster-import-config.yaml
See Table 1. YAML file parameters and description for details about each parameter in cluster-import-config.yaml.
Create a cluster resource. When you create the cluster resource, you automatically create a namespace, a service account, a secret, and a cluster registry in the hub cluster.
cloudctl mc cluster create -f cluster-import-config.yaml
See kubernetes/cluster-registry in the hub cluster.
Generate the cluster-import.yaml
cloudctl mc cluster import {name} [-n|--namespace {namespace}] > cluster-import.yaml
Table 1: The following table lists the parameters and descriptions that are available in the YAML file:
| Parameter | Description | Default value |
|---|---|---|
| clusterLabels | Provide cluster labels; you can add labels to your file | none |
| cloud | The cloud provider label for your cluster | auto-detect |
| vendor | The Kubernetes vendor label for your cluster | auto-detect |
| environment | The environment label for your cluster | Dev |
| region | The region where your cluster is set up | US |
| version | Version of multicluster-endpoint | 3.2.1 |
| ApplicationManager | Enables multicluster manager application deployment, deploys subscription controller and deployable controller | true |
| tillerIntegration | Enables IBM tiller to deploy Helm release | true |
| prometheusIntegration | Enables integration to IBM or OpenShift monitoring for metric collection | true |
| topologyCollector | Enables cluster topology data collection for the Topology page | true |
| searchCollector | Enables search collection and indexing | true |
| policyController | Enable the Governance and risk dashboard policy feature | true |
| metering | Enable the Governance and risk dashboard policy feature | false |
| serviceRegistry | Service registry that is used to discover services that are deployed by Application Deployable among managed clusters. | false |
| dnsSuffix | The suffix of the registry DNS name, which is added to the end of the target clusters dns domain name. | mcm.svc |
| plugins | Comma-separated list of enabled plugins. Supported plugins: kube-service, kube-ingress, and istio. |
kube-service |
| private_registry_enabled | Enable if using a private Docker registry | false |
| docker_username | User name for the private Docker registry | None |
| docker_password | Password for the private Docker registry | none |
| imageRegistry | The image registry from which to pull the multicluster-endpoint | ibmcom |
| imageNamePostfix | Postfix for the image name | none |
| migrateFrom320 | Migration from 3.2.0 multicluster-endpoint | false |
Note: Do not remove parameters, as the management console might not properly render.
Configure your kubectl for your targeted managed cluster.
See Supported cloud providers to learn how to configure your kubectl.
Run the following command to import the targeted managed cluster:
kubectl apply -f cluster-import.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"
Verify that the cluster is successfully imported.
You can delete your IBM Multicloud Manager managed cluster resources from the hub cluster so that it is not a managed cluster.
Log in to your hub cluster with cloudctl login.
cloudctl login -a https://<Cluster Master Host>:<Cluster Master API Port> --skip-ssl-validation
Run the following command to remove the managed cluster:
kubectl delete cluster {name} --namespace {namespace}
Removing a cluster can take a few minutes.
Verify that your cluster was removed from the list by running the following command:
kubectl get clusters --all-namespaces