Chapter 16. Discovery service introduction (Technology Preview)
You can discover OpenShift 4 clusters that are available from OpenShift Cluster Manager. After discovery, you can import your clusters to manage. The Discovery services uses the Discover Operator for back-end and console usage.
You must have an OpenShift Cluster Manager credential. See Creating a credential for Red Hat OpenShift Cluster Manager if you need to create a credential.
Required access: Administrator
16.1. Configure Discovery with the console (Technology Preview)
Use the product console to enable Discovery.
Required access: Access to the namespace where the credential was created.
16.1.1. Prerequisites
- You need a credential. See Creating a credential for Red Hat OpenShift Cluster Manager to connect to OpenShift Cluster Manager.
16.1.2. Configure Discovery
Configure Discovery in the console to find clusters. You can create multiple DiscoveryConfig
resources with separate credentials.
See the following procedure if you are using Discovery for the first time:
- Click Clusters in the console navigation.
- Click Configure Discovery to configure discovery settings.
Select a namespace and a credential.
- Select the namespace that contains your credentials.
- Select a credential within that namespace.
Set filters to discover relevant clusters.
- Choose the filter for the latest active clusters. For example, if you choose seven days, then you are searching for clusters that were active within the previous seven days.
- Choose the Red Hat OpenShift version.
- Click Add.
- View your discovered clusters in the console from the Clusters page.
- Optional: Create more clusters by clicking the Create discovery settings.
- Optional: Change or delete discovery settings by clicking the Configure discovery settings.
16.2. Enable Discovery using the CLI (Technology Preview)
Enable discovery using the CLI to find clusters that are available from Red Hat OpenShift Cluster Manager (link).
Required access: Administrator
16.2.1. Prerequisites
- Create a credential to connect to Red Hat OpenShift Cluster Manager.
16.2.2. Discovery set up and process
Note: The DiscoveryConfig
must be named discovery
and must be created in the same namespace as the selected credential
. See the following DiscoveryConfig
sample:
apiVersion: discovery.open-cluster-management.io/v1alpha1 kind: DiscoveryConfig metadata: name: discovery namespace: <NAMESPACE_NAME> spec: credential: <SECRET_NAME> filters: lastActive: 7 openshiftVersions: - "4.8" - "4.7" - "4.6" - "4.5"
-
Replace
SECRET_NAME
with the credential that you previously set up. -
Replace
NAMESPACE_NAME
with the namespace ofSECRET_NAME
. -
Enter the maximum time since last activity of your clusters (in days) to discover. For example,
lastActive: 7
means only clusters active in the last 7 days are discovered. -
Enter the versions of Red Hat OpenShift clusters to discover as a list of strings. Note: Every entry in the
openshiftVersions
list specifies an OpenShift major and minor version. For example, specifying"4.7"
will include all patch releases for the OpenShift version4.7
(4.7.1
,4.7.2
, etc.).
16.2.3. View discovered clusters
View discovered clusters by running oc get discoveredclusters -n <namespace>
where namespace
is the namespace where the discovery credential exists.
16.2.3.1. DiscoveredClusters
Objects are created by the Discovery controller. These DiscoveredClusters
represent the clusters that are found in OpenShift Cluster Manager by using the filters and credentials that are specified in the DiscoveryConfig
discoveredclusters.discovery.open-cluster-management.io
API. The value for name
is the cluster external ID:
apiVersion: discovery.open-cluster-management.io/v1alpha1 kind: DiscoveredCluster metadata: name: fd51aafa-95a8-41f7-a992-6fb95eed3c8e namespace: <NAMESPACE_NAME> spec: activity_timestamp: "2021-04-19T21:06:14Z" cloudProvider: vsphere console: https://console-openshift-console.apps.qe1-vmware-pkt.dev02.red-chesterfield.com creation_timestamp: "2021-04-19T16:29:53Z" credential: apiVersion: v1 kind: Secret name: <SECRET_NAME> namespace: <NAMESPACE_NAME> display_name: qe1-vmware-pkt.dev02.red-chesterfield.com name: fd51aafa-95a8-41f7-a992-6fb95eed3c8e openshiftVersion: 4.6.22 status: Stale
16.3. View discovered clusters (Technology Preview)
After you set up your credentials and discover your clusters for import, you can view them in the console.
- Click Cluster > Discovered clusters
View the populated table with the following information:
- Name is the display name that is designated in OpenShift Cluster Manager. If the cluster does not have a display name, a generated name based on the cluster console URL is displayed. If the console URL is missing or was modified manually in OpenShift Cluster Manager, the cluster external ID is displayed.
- Namespace is the namespace where you created the credential and discovered clusters.
- Type is the discovered cluster Red Hat OpenShift type.
- Distribution version is the discovered cluster Red Hat OpenShift version.
- Infrastructure provider is the cloud provider of the discovered cluster.
- Last active is the last time the discovered cluster was active.
- Created when the discovered cluster was created.
- Discovered when the discovered cluster was discovered.
- You can search for any information in the table, as well. For example, to show only Discovered clusters in a particular namespace, search for that namespace.
- You can now click Import cluster to create managed clusters. See Import discovered clusters.
16.4. Import discovered clusters (Technology Preview)
After you discover clusters, you can import clusters that appear in the Discovered clusters tab of the console.
16.4.1. Prerequisites
You need access to the namespaces that were used to configure Discovery.
16.4.2. Import Discovered clusters
- Navigate to the existing Clusters page and click on the Discovered clusters tab.
- From the Discovered clusters table, find the cluster that you want to import.
- From the options menu, choose Import cluster.
- For discovered clusters, you can import manually using the documentation, or you can choose Import clusters automatically.
- To import automatically with your credentials or Kubeconfig file, copy and paste the content.
- Click Import.