Chapter 1. multicluster engine operator with Red Hat Advanced Cluster Management integration
If you are using multicluster engine operator and then you install Red Hat Advanced Cluster Management, you can access more multicluster management features, such as Observability and Policy.
For integrated capability, see the following requirements:
- You need to install Red Hat Advanced Cluster Management. See the Red Hat Advanced Cluster Management Installing and upgrading documentation.
- See MultiClusterHub advanced configuration for details about Red Hat Advanced Cluster Management after you install.
See the following procedures for multicluster engine operator and Red Hat Advanced Cluster Management multicluster management:
1.1. Discovering multicluster engine operator hosted clusters in Red Hat Advanced Cluster Management Copy linkLink copied to clipboard!
If you have multicluster engine operator clusters that are hosting multiple hosted clusters, you can bring those hosted clusters to a Red Hat Advanced Cluster Management hub cluster to manage with Red Hat Advanced Cluster Management management components, such as Application lifecycle and Governance.
Those hosted clusters can be automatically discovered and imported as managed clusters.
Note: Since the hosted control planes run on the managed multicluster engine operator cluster nodes, the number of hosted control planes that the cluster can host is determined by the resource availability of managed multicluster engine operator cluster nodes, as well as the number of managed multicluster engine operator clusters. You can add more nodes or managed clusters to host more hosted control planes.
Required access: Cluster administrator
1.1.1. Prerequisites Copy linkLink copied to clipboard!
- You need one or more multicluster engine operator clusters.
- You need a Red Hat Advanced Cluster Management cluster that is set as your hub cluster.
Install the
clusteradmCLI by running the following command:curl -L https://raw.githubusercontent.com/open-cluster-management-io/clusteradm/main/install.sh | bash
curl -L https://raw.githubusercontent.com/open-cluster-management-io/clusteradm/main/install.sh | bashCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.1.2. Configuring Red Hat Advanced Cluster Management to import multicluster engine operator clusters Copy linkLink copied to clipboard!
multicluster engine operator has a local-cluster, which is a hub cluster that is managed. The following default addons are enabled for this local-cluster in the open-cluster-management-agent-addon namespace:
-
cluster-proxy -
managed-serviceaccount -
work-manager
1.1.2.1. Configuring add-ons Copy linkLink copied to clipboard!
When your multicluster engine operator is imported into Red Hat Advanced Cluster Management, Red Hat Advanced Cluster Management enables the same set of add-ons to manage the multicluster engine operator.
Install those add-ons in a different multicluster engine operator namespace so that the multicluster engine operator can self-manage with the local-cluster add-ons while Red Hat Advanced Cluster Management manages multicluster engine operator at the same time. Complete the following procedure:
- Log in to your Red Hat Advanced Cluster Management with the CLI.
Create the
AddOnDeploymentConfigresource to specify a different add-on installation namespace. See the following example whereagentInstallNamespacereferencesopen-cluster-management-agent-addon-discovery:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Run
oc apply -f <filename>.yamlto apply the file. Update the existing
ClusterManagementAddOnresources for the add-ons so that the add-ons are installed in theopen-cluster-management-agent-addon-discoverynamespace that is specified in theAddOnDeploymentConfigresource that you created. See the following example withopen-cluster-management-global-setas the namespace:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the
addonDeploymentConfigsto theClusterManagementAddOn. See the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the
AddOnDeploymentConfigto themanaged-serviceaccount. See the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the
addondeploymentconfigsvalue to theClusterManagementAddOnresource namedcluster-proxy. See the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Add the
addondeploymentconfigsvalue to theClusterManagementAddOnresource namedapplication-manager. See the following example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to verify that the add-ons for the Red Hat Advanced Cluster Management
local-clusterare re-installed into the namespace that you specified:oc get deployment -n open-cluster-management-agent-addon-discovery
oc get deployment -n open-cluster-management-agent-addon-discoveryCopy to Clipboard Copied! Toggle word wrap Toggle overflow See the following output example:
NAME READY STATUS RESTARTS AGE application-manager-6b7f74b8f7-7sd25 1/1 Running 0 5d18h cluster-proxy-proxy-agent-7985ddfdb6-kng5p 3/3 Running 0 5d18h klusterlet-addon-workmgr-55fd575b4b-rs5vz 1/1 Running 0 5d18h managed-serviceaccount-addon-agent-54bd989b94-g6gz9 1/1 Running 0 5d18h
NAME READY STATUS RESTARTS AGE application-manager-6b7f74b8f7-7sd25 1/1 Running 0 5d18h cluster-proxy-proxy-agent-7985ddfdb6-kng5p 3/3 Running 0 5d18h klusterlet-addon-workmgr-55fd575b4b-rs5vz 1/1 Running 0 5d18h managed-serviceaccount-addon-agent-54bd989b94-g6gz9 1/1 Running 0 5d18hCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.1.2.2. Creating a KlusterletConfig resource Copy linkLink copied to clipboard!
multicluster engine operator has a local-cluster, which is a hub cluster that is managed. A resource named klusterlet is created for this local-cluster.
When your multicluster engine operator is imported into Red Hat Advanced Cluster Management, Red Hat Advanced Cluster Management installs the klusterlet with the same name, klusterlet, to manage the multicluster engine operator. This conflicts with the multicluster engine operator local-cluster klusterlet.
You need to create a KlusterletConfig resource that is used by ManagedCluster resources to import multicluster engine operator clusters so that the klusterlet is installed with a different name to avoid the conflict. Complete the following procedure:
Create a
KlusterletConfigresource using the following example. When thisKlusterletConfigresource is referenced in a managed cluster, the value in thespec.installMode.noOperator.postfixfield is used as a suffix to the klusterlet name, such asklusterlet-mce-import:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Run
oc apply -f <filename>.yamlto apply the file.
1.1.2.3. Configure for backup and restore Copy linkLink copied to clipboard!
Since you installed Red Hat Advanced Cluster Management, you can also use the Backup and restore feature.
If the hub cluster is restored in a disaster recovery scenario, the imported multicluster engine operator clusters and hosted clusters are imported to the newer Red Hat Advanced Cluster Management hub cluster.
In this scenario, you need to restore the previous configurations as part of Red Hat Advanced Cluster Management hub cluster restore.
Add the backup=true label to enable backup. See the following steps for each add-on:
For your
addon-ns-config, run the following command:oc label addondeploymentconfig addon-ns-config -n multicluster-engine cluster.open-cluster-management.io/backup=true
oc label addondeploymentconfig addon-ns-config -n multicluster-engine cluster.open-cluster-management.io/backup=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow For your
hypershift-addon-deploy-config, run the following command:oc label addondeploymentconfig hypershift-addon-deploy-config -n multicluster-engine cluster.open-cluster-management.io/backup=true
oc label addondeploymentconfig hypershift-addon-deploy-config -n multicluster-engine cluster.open-cluster-management.io/backup=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow For your
work-manager, run the following command:oc label clustermanagementaddon work-manager cluster.open-cluster-management.io/backup=true
oc label clustermanagementaddon work-manager cluster.open-cluster-management.io/backup=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow For your `cluster-proxy `, run the following command:
oc label clustermanagementaddon cluster-proxy cluster.open-cluster-management.io/backup=true
oc label clustermanagementaddon cluster-proxy cluster.open-cluster-management.io/backup=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow For your
managed-serviceaccount, run the following command:oc label clustermanagementaddon managed-serviceaccount cluster.open-cluster-management.io/backup=true
oc label clustermanagementaddon managed-serviceaccount cluster.open-cluster-management.io/backup=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow For your
mce-import-klusterlet-config, run the following command:oc label KlusterletConfig mce-import-klusterlet-config cluster.open-cluster-management.io/backup=true
oc label KlusterletConfig mce-import-klusterlet-config cluster.open-cluster-management.io/backup=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.1.3. Importing multicluster engine operator manually Copy linkLink copied to clipboard!
To manually import an multicluster engine operator cluster from your Red Hat Advanced Cluster Management cluster, complete the following procedure:
From your Red Hat Advanced Cluster Management cluster, create a
ManagedClusterresource manually to import an multicluster engine operator cluster. See the following file example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
mce-import-klusterlet-configannotation references theKlusterletConfigresource that you created in the previous step to install the Red Hat Advanced Cluster Management klusterlet with a different name in multicluster engine operator. - 2
- The example imports an multicluster engine operator managed cluster named
mce-a.
-
Run
oc apply -f <filename>.yamlto apply the file. Create the
auto-import-secretsecret that references thekubeconfigof the multicluster engine operator cluster. Go to Importing a cluster by using the auto import secret in Importing a managed cluster by using the CLI to add the auto import secret to complete the multicluster engine operator auto-import process.After you create the auto import secret in the multicluster engine operator managed cluster namespace in the Red Hat Advanced Cluster Management cluster, the managed cluster is registered.
Run the following command to get the status:
oc get managedcluster
oc get managedclusterCopy to Clipboard Copied! Toggle word wrap Toggle overflow See following example output with the status and example URLs of managed clusters:
NAME HUB ACCEPTED MANAGED CLUSTER URLS JOINED AVAILABLE AGE local-cluster true https://<api.acm-hub.com:port> True True 44h mce-a true https://<api.mce-a.com:port> True True 27s
NAME HUB ACCEPTED MANAGED CLUSTER URLS JOINED AVAILABLE AGE local-cluster true https://<api.acm-hub.com:port> True True 44h mce-a true https://<api.mce-a.com:port> True True 27sCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Important: Do not enable any other Red Hat Advanced Cluster Management add-ons for the imported multicluster engine operator.
1.1.4. Discovering hosted clusters Copy linkLink copied to clipboard!
After all your multicluster engine operator clusters are imported into Red Hat Advanced Cluster Management, you need to enable the hypershift-addon for those managed multicluster engine operator clusters to discover the hosted clusters.
Default add-ons are installed into a different namespace in the previous procedures. Similarly, you install the hypershift-addon into a different namespace in multicluster engine operator so that the add-ons agent for multicluster engine operator local-cluster and the agent for Red Hat Advanced Cluster Management can work in multicluster engine operator.
Important: For all the following commands, replace <managed-cluster-names> with comma-separated managed cluster names for multicluster engine operator.
Run the following command to set the
agentInstallNamespacenamespace of the add-on toopen-cluster-management-agent-addon-discovery:oc patch addondeploymentconfig hypershift-addon-deploy-config -n multicluster-engine --type=merge -p '{"spec":{"agentInstallNamespace":"open-cluster-management-agent-addon-discovery"}}'oc patch addondeploymentconfig hypershift-addon-deploy-config -n multicluster-engine --type=merge -p '{"spec":{"agentInstallNamespace":"open-cluster-management-agent-addon-discovery"}}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to disable metrics and to disable the HyperShift operator management:
oc patch addondeploymentconfig hypershift-addon-deploy-config -n multicluster-engine --type=merge -p '{"spec":{"customizedVariables":[{"name":"disableMetrics","value": "true"},{"name":"disableHOManagement","value": "true"}]}}'oc patch addondeploymentconfig hypershift-addon-deploy-config -n multicluster-engine --type=merge -p '{"spec":{"customizedVariables":[{"name":"disableMetrics","value": "true"},{"name":"disableHOManagement","value": "true"}]}}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to enable the
hypershift-addonfor multicluster engine operator:clusteradm addon enable --names hypershift-addon --clusters <managed-cluster-names>
clusteradm addon enable --names hypershift-addon --clusters <managed-cluster-names>Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can get the multicluster engine operator managed cluster names by running the following command in Red Hat Advanced Cluster Management.
oc get managedcluster
oc get managedclusterCopy to Clipboard Copied! Toggle word wrap Toggle overflow Log into multicluster engine operator clusters and verify that the
hypershift-addonis installed in the namespace that you specified. Run the following command:oc get deployment -n open-cluster-management-agent-addon-discovery
oc get deployment -n open-cluster-management-agent-addon-discoveryCopy to Clipboard Copied! Toggle word wrap Toggle overflow See the following example output that lists the add-ons:
NAME READY UP-TO-DATE AVAILABLE AGE cluster-proxy-proxy-agent 1/1 1 1 24h klusterlet-addon-workmgr 1/1 1 1 24h hypershift-addon-agent 1/1 1 1 24h managed-serviceaccount-addon-agent 1/1 1 1 24h
NAME READY UP-TO-DATE AVAILABLE AGE cluster-proxy-proxy-agent 1/1 1 1 24h klusterlet-addon-workmgr 1/1 1 1 24h hypershift-addon-agent 1/1 1 1 24h managed-serviceaccount-addon-agent 1/1 1 1 24hCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Red Hat Advanced Cluster Management deploys the hypershift-addon, which is the discovery agent that discovers hosted clusters from multicluster engine operator. The agent creates the corresponding DiscoveredCluster custom resource in the multicluster engine operator managed cluster namespace in the Red Hat Advanced Cluster Management hub cluster when the hosted cluster kube-apiserver becomes available.
You can view your discovered clusters in the console.
- Log into hub cluster console and navigate to All Clusters > Infrastructure > Clusters.
-
Find the Discovered clusters tab to view all discovered hosted clusters from multicluster engine operator with type
MultiClusterEngineHCP.
Next, visit Automating import for discovered hosted clusters to learn how to automatically import clusters.
1.2. Automating import for discovered hosted clusters Copy linkLink copied to clipboard!
Automate the import of hosted clusters by using the DiscoveredCluster resource for faster cluster management, without manually importing individual clusters.
When you automatically import a discovered hosted cluster into Red Hat Advanced Cluster Management, all Red Hat Advanced Cluster Management add-ons are enabled so that you can start managing the hosted clusters with the available management tools.
The hosted cluster is also auto-imported into multicluster engine operator. Through the multicluster engine operator console, you can manage the hosted cluster lifecycle. However, you cannot manage the hosted cluster lifecycle from the Red Hat Advanced Cluster Management console.
Required access: Cluster administrator
1.2.1. Prerequisites Copy linkLink copied to clipboard!
- You need Red Hat Advanced Cluster Management installed. See the Red Hat Advanced Cluster Management Installing and upgrading documentation.
- You need to learn about Policies. See the introduction to Governance in the Red Hat Advanced Cluster Management documentation.
1.2.2. Configuring settings for automatic import Copy linkLink copied to clipboard!
Discovered hosted clusters from managed multicluster engine operator clusters are represented in DiscoveredCluster custom resources, which are located in the managed multicluster engine operator cluster namespace in Red Hat Advanced Cluster Management. See the following DiscoveredCluster resource and namespace example:
These discovered hosted clusters are not automatically imported into Red Hat Advanced Cluster Management until the spec.importAsManagedCluster field is set to true. Learn how to use a Red Hat Advanced Cluster Management policy to automatically set this field to true for all type.MultiClusterEngineHCP within DiscoveredCluster resources so that discovered hosted clusters are immediately automatically imported into Red Hat Advanced Cluster Management.
Configure your Policy to import all your discovered hosted clusters automatically. Log in to your hub cluster from the CLI to complete the following procedure:
Create a YAML file for your
DiscoveredClustercustom resource and edit the configuration that is referenced in the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Run
oc apply -f <filename>.yaml -n <namespace>to apply the file.
1.2.3. Creating the placement definition Copy linkLink copied to clipboard!
You need to create a placement definition that specifies the managed cluster for the policy deployment. Complete the following procedure:
Create the
Placementdefinition that selects only thelocal-cluster, which is a hub cluster that is managed. Use the following YAML sample:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Run
oc apply -f placement.yaml -n <namespace>, wherenamespacematches the namespace that you used for the policy that you previously created.
1.2.4. Binding the import policy to a placement definition Copy linkLink copied to clipboard!
After you create the policy and the placement, you need to connect the two resources. Complete the following steps:
Connect the resources by using a
PlacementBindingresource. See the following example whereplacementRefreferences thePlacementthat you created, andsubjectsreferences thePolicythat you created:Copy to Clipboard Copied! Toggle word wrap Toggle overflow To verify, run the following command:
oc get policies.policy.open-cluster-management.io policy-mce-hcp-autoimport -n <namespace>
oc get policies.policy.open-cluster-management.io policy-mce-hcp-autoimport -n <namespace>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Important: You can detach a hosted cluster from Red Hat Advanced Cluster Management by using the Detach option in the Red Hat Advanced Cluster Management console, or by removing the corresponding ManagedCluster custom resource from the command line.
For best results, detach the managed hosted cluster before destroying the hosted cluster.
When a discovered cluster is detached, the following annotation is added to the DiscoveredCluster resource to prevent the policy to import the discovered cluster again.
annotations:
discovery.open-cluster-management.io/previously-auto-imported: "true"
annotations:
discovery.open-cluster-management.io/previously-auto-imported: "true"
If you want the detached discovered cluster to be reimported, remove this annotation.
1.3. Automating import for discovered OpenShift Service on AWS clusters Copy linkLink copied to clipboard!
Automate the import of OpenShift Service on AWS clusters by using Red Hat Advanced Cluster Management policy enforcement for faster cluster management, without manually importing individual clusters.
Required access: Cluster administrator
1.3.1. Prerequisites Copy linkLink copied to clipboard!
- You need Red Hat Advanced Cluster Management installed. See the Red Hat Advanced Cluster Management Installing and upgrading documentation.
- You need to learn about Policies. See the introduction to Governance in the Red Hat Advanced Cluster Management documentation.
1.3.2. Creating the automatic import policy Copy linkLink copied to clipboard!
The following policy and procedure is an example of how to import all your discovered OpenShift Service on AWS clusters automatically.
Log in to your hub cluster from the CLI to complete the following procedure:
Create a YAML file with the following example and apply the changes that are referenced:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- To enable automatic import, change the
spec.remediationActiontoenforce. - 2
- Optional: Specify a value here to select a subset of the matching OpenShift Service on AWS clusters, which are based on discovered cluster names. The
rosa-filterhas no value by default, so the filter does not restrict cluster names without a subset value.
-
Run
oc apply -f <filename>.yaml -n <namespace>to apply the file.
1.3.3. Creating the placement definition Copy linkLink copied to clipboard!
You need to create a placement definition that specifies the managed cluster for the policy deployment.
Create the placement definition that selects only the
local-cluster, which is a hub cluster that is managed. Use the following YAML sample:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Run
oc apply -f placement.yaml -n <namespace>, wherenamespacematches the namespace that you used for the policy that you previously created.
1.3.4. Binding the import policy to a placement definition Copy linkLink copied to clipboard!
After you create the policy and the placement, you need to connect the two resources.
Connect the resources by using a
PlacementBinding. See the following example whereplacementRefreferences thePlacementthat you created, andsubjectsreferences thePolicythat you created:Copy to Clipboard Copied! Toggle word wrap Toggle overflow To verify, run the following command:
oc get policies.policy.open-cluster-management.io policy-rosa-autoimport -n <namespace>
oc get policies.policy.open-cluster-management.io policy-rosa-autoimport -n <namespace>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.4. Observability integration Copy linkLink copied to clipboard!
With the Red Hat Advanced Cluster Management Observability feature, you can view health and utilization of clusters across your fleet. You can install Red Hat Advanced Cluster Management and enable Observability.
1.4.1. Observing hosted control planes Copy linkLink copied to clipboard!
After you enable the multicluster-observability pod, you can use Red Hat Advanced Cluster Management Observability Grafana dashboards to view the following information about your hosted control planes:
- ACM > Hosted Control Planes Overview dashboard to see cluster capacity estimates for hosting hosted control planes, the related cluster resources, and the list and status of existing hosted control planes. For more information, see: Introduction to hosted control planes.
- ACM > Resources > Hosted Control Plane dashboard that you can access from the Overview page to see the resource utilization of the selected hosted control plane. For more information, see Installing the hosted control planes command-line interface.
To enable, see Observability service.