Site icon techbeatly

Install the RHACM operator – import an existing cluster – Deploy a new cluster

This blog shows how to prepare RHACM and manage the cluster on AWS.

Installing Red Hat Advanced Cluster Management

Using OperatorHub, install the Advanced Cluster Management for Kubernetes operator in the cluster-bn7z2.sandbox1558.opentlc.com cluster.

Navigate to Operators → OperatorHub and type Advanced Cluster Management in the Filter by keyword field.

Click Advanced Cluster Management for Kubernetes, and then click Install.

In the Update Channel, ensure that the release-2.6 radio button is selected. In the Update approval section, select the Manual radio button to select a manual approval strategy. Then, click Install.

Next, you must approve the installation or updates to the RHACM operator manually.

Click Approve in the next step. The installation can take a few minutes to complete.

When the operator is installed, you see the following message:

Click Create MulticlusterHub.

On the Create MulticlusterHub page, leave the default values, and click Create. You are redirected to the MultiClusterHubs tab.

Initially, the multiclusterhub object has a Phase: Installing status.

After some minutes, the status Phase: Running displays in the Status column.

Retrieve the route to the RHACM web console, named multicloud-console on hub cluster

$ oc get route multicloud-console -n open-cluster-management
NAME                 HOST/PORT                                                       PATH   SERVICES             PORT    TERMINATION          WILDCARD
multicloud-console   multicloud-console.apps.cluster-bn7z2.sandbox1558.opentlc.com          management-ingress   https   reencrypt/Redirect   None

Open the RHACM web console at https://multicloud-console.apps.cluster-bn7z2.sandbox1558.opentlc.com with the hub “kubeadmin” credential.

Import an existing cluster

Explore the Infrastructure → Clusters menu.

From the Infrastructure menu, click Clusters. Scroll down to locate the managed clusters. Notice that the local-cluster cluster-bn7z2.sandbox1558.opentlc.com cluster, where the hub cluster runs, is automatically managed.

On the Import an existing cluster page, type the name to identify this cluster as follows:

Leave the rest of the values unchanged and click Save import and generate code.

The Save import and generate code button now displays the Code generated successfully message.

Click Copy command.

From the terminal, log in to the bn7z2-m-pod.sandbox1558.opentlc.com cluster as the admin user. The API server address is https://api.bn7z2-m-pod.sandbox1558.opentlc.com:6443

Paste the import code into the terminal and then press Enter to run it. The paste command is quite long and most of it is base64 encoded.

$ echo "Ci0tLQphcGlWZXJzaW9uOiB...CBhZ2Fpbi4=" | base64 -d

Deploy Managed OpenShift Clusters

Set Up Credentials for AWS

Create a new Namespace called opentlc-aws to hold the configuration for AWS.

$ oc create namespace opentlc-aws

In the RHACM console, click Credentials.

Click Add Credentials and select Amazon Web Services.

Specify the following values:

Click Next.

For Access key ID, paste the access key ID

For Secret access key, paste the secret access key

Click Next and skip the Proxy settings.

Click Next and specify your OpenShift pull secret for the Pull Secret field.

For SSH Private Key, paste the output from the cat HOME/.ssh/{GUID}key.pem command—your private key.

For SSH Public Key, paste the output from the cat HOME/.ssh/{GUID}key.pub; echo command—your public key.

Click Next.

Verify that your entries are correct, then click Add.

Deploy New Development Cluster

I deploy one managed OpenShift cluster for development. Because you do not actually use these clusters for any productive work, you deploy single-node OpenShift (SNO) clusters. These clusters consist of only a single VM that acts as the control plane and worker.

Watch the deployment logs until the production cluster is successfully deployed.

Remove a managed cluster

# Managed Cluster

$ oc login -u admin -p redhat https://api.<cluster name>.<base domain>:6443

$ oc delete clusterrole klusterlet

$ oc delete clusterrole open-cluster-management:klusterlet-admin-aggregate-clusterrole

Now we have a “playground” to test RHACM GitOps. I will talk about it in the next Blog.

Exit mobile version