Uploaded image for project: 'Red Hat Advanced Cluster Management'
  1. Red Hat Advanced Cluster Management
  2. ACM-10866

[Doc] Discovery operator to import discovered managed cluster automatically

XMLWordPrintable

    • 1
    • False
    • None
    • False
    • ACM-639 - Discovery and import for managed OpenShift
    • Installer Sprint 2024-35, Installer Sprint 2024-36, Installer Sprint 2024-37
    • No

      Create an informative issue (See each section, incomplete templates/issues won't be triaged)

      Using the current documentation as a model, please complete the issue template. 

      Note: Doc team updates the current version and the two previous versions (n-2). For earlier versions, we will address only high-priority, customer-reported issues for releases in support.

      Prerequisite: Start with what we have

      Always look at the current documentation to describe the change that is needed. Use the source or portal link for Step 4:

       - Use the Customer Portal: https://access.redhat.com/documentation/en-us/red_hat_advanced_cluster_management_for_kubernetes

       - Use the GitHub link to find the staged docs in the repository: https://github.com/stolostron/rhacm-docs 

      Describe the changes in the doc and link to your dev story

      Provide info for the following steps:

      1. - [x] Mandatory Add the required version to the Fix version/s field.

      2. - [x] Mandatory Choose the type of documentation change.

            - [x] New topic in an existing section or new section
            - [ ] Update to an existing topic

      3. - [x] Mandatory for GA content:
                  
             - [x] Add steps and/or other important conceptual information here: 

      • When configuring the Discovery feature on a cluster, a user is required to enable a DiscoveryConfig to connect to OpenShift Cluster Manager (OCM) to begin discovering clusters that are a part of their organization. In MCE 2.6, after the clusters has been discovered by the discovery-operator, users can now automatically import their discovered ROSA clusters into their ACM/MCE hub cluster.

      Import DiscoveredCluster Automatically:

      • In MCE 2.6, the discovery-operator will support the automatic import of ROSA clusters into the ACM hub cluster. Previously, when a user wanted to import a ROSA cluster into their hub, they would be required to go through multiple steps from the console; however, this feature will allow them to enable a field within the DiscoveredCluster resource instance to automatically handle that flow.
      • To automatically import the DiscoveredCluster, the user will need to modify the DiscoveredCluster spec and set the importAsManagedCluster field to true. By setting this field to true, the discovery operator will execute the import flow for the DiscoveredCluster resource. The DiscoveredCluster instance might resemble the following: 
        apiVersion: discovery.open-cluster-management.io/v1
        kind: DiscoveredCluster
        metadata:
          name: 28c17977-fc73-4050-b5cc-a5aa2d1d6892
          namespace: discovery
        spec:
          openshiftVersion: 4.14.26
          isManagedCluster: false
          cloudProvider: aws   
          name: 28c17977-fc73-4050-b5cc-a5aa2d1d6892   
          displayName: rosa-dc
          status: Active
          importAsManagedCluster: true
          type: ROSA
      • After the field is set to true, the discovery operator will create the namespace for the DiscoveredCluster resource and then create a ManagedCluster, KlusterletAddOnConfig (only if ACM is installed), and the auto import Secret for the cluster.

      Detaching ManagedCluster:

      • If the ManagedCluster instance for the DiscoveredCluster resource that is being managed by the hub cluster is removed or detached at any moment, an annotation will be applied to the DiscoveredCluster resource. The annotation will identify that the cluster was previously automatically imported; therefore, to prevent reimporting it automatically again the following annotation is applied: 
        apiVersion: discovery.open-cluster-management.io/v1
        kind: DiscoveredCluster
        metadata:
          annotations:
            discovery.open-cluster-management.io/previously-auto-imported: 'true'
      • If a user tries to reimport the DiscoveredCluster while the annotation is applied, they will see the following log message within the discovery operator: 
        2024-06-12T14:11:43.366Z INFO reconcile	Skipped automatic import for DiscoveredCluster due to 
        existing 'discovery.open-cluster-management.io/previously-auto-imported' annotation {"Name": "rosa-dc"} 
      • To reimport the DiscoveredCluster automatically, the user will need to remove the annotation beforehand.

      Automatically Importing Non ROSA clusters

      • If a user tries to automatically import a non ROSA cluster, the import flow will not trigger. Users will need to manual import other kind DiscoveredCluster resources due to the other clusters requiring kubeconfigs to be applied directly onto the cluster. If they try to enable the importAsManagedCluster field, the Discovery webhook will prevent it from updating.
      • Note: If a DiscoveredCluster is of type MultiClusterEngineHCP, they can automatically import it; however, the DiscoveredCluster is not provided through OCM but Hypershift (I would reach out to HyperShift for a link to a doc to explain the Hypershift flow).

      Triggering Automatic Import Flow Via Policy

             - [x] Add Required access level for the user to complete the task here:

      • Access to ROSA DiscoveredCluster (not all discoveredcluster listed can be imported).      

             - [x] Add verification at the end of the task, how does the user verify success (a command to run or a result to see?)

      • After setting the DiscoveredCluster spec.importAsManagedCluster field to true, the user will see a ManagedCluster being imported into their hub cluster. The process will take approximately 3-5mins to import the cluster for the user to use

              - [x] Add link to dev story here: https://issues.redhat.com/browse/ACM-10560

      4. - [ ] Mandatory for bugs: What is the diff? Clearly define what the problem is, what the change is, and link to the current documentation:

            mdockery@redhat.com Mikela Jackson
            dbennett@redhat.com Disaiah Bennett
            Thuy Nguyen Thuy Nguyen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: