Clusters
Register OpenShift cluster with Red Hat Marketplace
To install operators and container images from Red Hat Marketplace to your OpenShift cluster, first register the OpenShift cluster on Red Hat Marketplace.
Prerequisites
- Add Cluster Admin role to your Red Hat Marketplace user profile.
- Install OpenShift Container Platform, major version 4 with any available supported minor version or Red Hat CodeReady Containers.
- Install the version of the
OpenShift Command-line Interface (CLI),
commonly known as
oc
, that matches your version of OpenShift. - Install the jq package.
- Login to your OpenShift cluster as a cluster admin.
- Enable OpenShift user workload monitoring
About this task
To register a cluster, Red Hat Marketplace provides commands to install the IBM Metrics Operator, Red Hat Marketplace Deployment Operator, and update your global cluster pull secret. To learn more about the Operators, refer to About Red Hat Marketplace Deployment Operator.
Note: When the command updates your global cluster pull secret, you may experience temporary interruptions to applications and services on the cluster.
Procedure
-
On the main menu, click Workspace, click Clusters, and then click Add cluster.
-
To create a pull secret, do the following:
- Optional - A default name shows on the Pull secret name box. To rename, on the Pull secret name box, enter a new name.
- Click Generate Secret.
-
To create a namespace, copy the Create namespace command, paste it on the command line, and run the command.
-
To create the operator subscription, copy the Create Red Hat Marketplace Subscription command, paste it on the command line, and run the command.
- By default, the command installs the operator subscriptions with
automatic updates. To
change the subscription to manual updates, copy the following command,
paste it on the command line, and run the command.
Note: To manually approve updates, go to your OpenShift Container Platform web console to approve the installation.oc apply -f "https://marketplace.redhat.com/provisioning/v1/rhm-operator/rhm-operator-subscription?approvalStrategy=Manual&metrics=true&deployment=true"
- By default, the command installs the operator subscriptions with
automatic updates. To
change the subscription to manual updates, copy the following command,
paste it on the command line, and run the command.
-
To create the Kubernetes secret, copy the Create Red Hat Marketplace Kubernetes Secret command, paste it on the command line, and run the command.
-
To create the marketplace secret, copy the Add the Red Hat Marketplace pull secret command, paste it on the command line, and run the command.
Result
You connected your cluster to Red Hat Marketplace. Your cluster is ready to be a target cluster for installing and managing software purchases from Red Hat Marketplace. Users associated to your Red Hat Marketplace account can install operators on to the registered cluster.
Next steps
- To view your cluster, on the Add Cluster page, click View Clusters tile.
- To find your cluster name, refer to Find cluster name
About cluster name
Red Hat Marketplace associates a unique ID to each registered cluster. The marketplace refers to the unique ID as the cluster name.
Find cluster name
Prerequisites
- Login to your OpenShift cluster as a cluster admin
Procedure
- To find your cluster name, copy the following command, paste it on the command line, and run the command.
oc get clusterversion -o jsonpath='{.items[].spec.clusterID}{"\n"}'
Result
The cluster name shows on the command line.
Related topics
Edit cluster name
Prerequisites
Procedure
- On the main menu, click Workspace, click Clusters.
- On the row of your cluster, click the Menu options button (three dots), and then click View details. The Cluster details page shows.
- To edit cluster name, click Edit, on the Cluster name box, enter a new name, and then click Update.
Result
You edited the cluster name.
Register OpenShift cluster on Red Hat CodeReady Containers
Users can try operators locally with Red Hat CodeReady Containers. Red Hat Marketplace recommends local clusters for tasks with minimal performance requirements. To try all product features and functions, Red Hat Marketplace recommends installing operators and container images on remote OpenShift clusters, instead of clusters on local CodeReady Containers.
Prerequisites
- Set up an OpenShift cluster on your local machine
- Start your CodeReady Containers virtual machine
- Register your local cluster with Red Hat Marketplace
About this task
On Red Hat Marketplace, users register local clusters similarly to remote clusters. However, for local clusters, to prepare it for operators, there is an additional procedure. Run the following commands after you register your cluster on Red Hat Marketplace.
Procedure
- To get the configuration information, run the following command, and then
copy and paste the output to use later:
oc get secret pull-secret -n openshift-config --output="jsonpath={.data.\.dockerconfigjson}" | base64 --decode
- To get the Node Name, run the following command, and then copy and paste the
output to use later:
oc get node
- To navigate to the node
sh-4.2#
, run the following command. Ensure you replace<nodename>
with the Node Name you copied in step 2.oc debug node/<nodename> - When the node shows, to navigate to the pod
sh-4.4#
, run the following command:chroot /host - Navigate to the following file: /var/lib/kubelet/config.json.
cd /var/lib/kubelet/
- To debug the node, open the config.json file and replace the content in the
file with the output you copied on step 1.
vi config.jsonggdGi<paste output from step 1>:wq
- To exit the node, run the following command:
exit
- Run the
exit
command again until the the following message shows:Removing debug pod ...
- Stop your CodeReady Containers virtual machine, and then start it again.
crc stopcrc start
Result
Your local cluster is configured for Red Hat Marketplace.
Next Steps
Install an Operator to your local cluster.
Get pull secret
Use the pull secret to update your global cluster pull secret.
Procedure
- On the main menu, click your user name, click My Account, click Pull secrets, and then click Create pull secret.
- On the Pull secret name box, enter a unique name for your pull secret.
- To get your pull secret, on the Your pull secret box, click the Copy button (copy icon).
- Click Save.
Result
You copied your pull secret.
Related topics
Delete pull secret
Prerequisites
- Create a pull secret
About this task
Delete a pull secret when your cluster no longer needs to access image registries or when you rotate your pull secrets.
Note: delete pull secret locks access to image registries. Only delete the secret when you no longer need to access the image registry or when you replace a secret with a new secret.
Procedure
- On the main menu, click your user name, click My Account, and then click Pull secrets.
- On the row of the pull secret, click the Menu Options button (dots icon), and then click Delete.
- To delete the pull secret, click Delete.
Result
You deleted the pull secret.
Unregister OpenShift cluster
Prerequisites
- Associate the Cluster Admin role to your Red Hat Marketplace user profile
- Login to your OpenShift cluster as a cluster admin
Procedure
- On the main menu, click Workspace, and then click Clusters.
- On the row of the registered cluster, click the Menu Options button (dots icon), and then click Unregister.
- To unregister your cluster, copy the following command, paste it on the
command line, and run the command:
oc delete subscription redhat-marketplace-operator -n openshift-redhat-marketplaceoc delete MarketplaceConfig marketplaceconfig -n openshift-redhat-marketplaceoc get csv -n openshift-redhat-marketplace --no-headers | awk '/redhat-marketplace-operator/{print $1}' | xargs oc delete -n openshift-redhat-marketplace csv
- Click Confirm.
Result
On the Clusters page, the status changes to To be unregistered. When Red Hat Marketplace confirms communication stopped between your cluster and Red Hat Marketplace, the cluster no longer shows on the Clusters page.
Remove offline cluster from list
Prerequisites
- Login to Red Hat Marketplace as a cluster admin user
Procedure
- On the main menu, click Workspace, and then click Clusters.
- On the row of the offline cluster, click the Menu Options button (dots icon), and then click Remove.
- To remove the offline cluster from the list, click Remove.
Result
On the Clusters page, a success message shows and the cluster is removed from the list.
Cluster status descriptions
The following table shows descriptions of cluster status:
Status | Description | Next steps |
---|---|---|
Connected | You registered your cluster with the marketplace | Install product operators or unregister cluster |
Offline | You unregistered your cluster from the marketplace. | Remove offline cluster from list |
Operator not installed | You named the cluster but have not installed Red Hat Marketplace Deployment Operator. | On the row of the cluster, click Menu options (dots icon), click Register, and then complete the steps that show on the window. |
To be unregistered | You unregistered your cluster from the marketplace. | After 1 hour, the cluster status shows as Offline. |
Open OpenShift Container Platform web console
Prerequisites
- Register your OpenShift cluster with Red Hat Marketplace
Procedure
- On the main menu, click Workspace, and then click Clusters.
- On the row of the cluster, click the Menu Options button (dots icon), and then click Cluster Console.
Result
Your OpenShift console opens in a new tab on your web browser.