Digital Developer Conference: Cloud Security 2021 -- Build the skills to secure your cloud and data Register free

Set up Red Hat Advanced Cluster Management for Kubernetes on IBM Power Systems Virtual Server

Introduction

In this tutorial, you will deploy a Red Hat Advanced Cluster Management for Kubernetes console on IBM Power Systems Virtual Server. You can use this console to quickly and easily deploy applications and policies on one or multiple clusters. This tutorial provides you resources and explanations to set up an example application and policy.

Red Hat Advanced Cluster Management for Kubernetes provides you a secure and quick way to manage the lifecycle of your Red Hat OpenShift Container Platform clusters, applications, and operators from a secure single console.

This tutorial is not a comprehensive learning about Red Hat Advanced Cluster Management for Kubernetes, but rather a quick learning tutorial to help accelerate your Red Hat Advanced Cluster Management for Kubernetes journey.

Prerequisites

Knowledge

To perform the tasks in this tutorial, minimum knowledge on the following topics is required:

References

To get started, you need to create an OpenShift Container Platform cluster running in Power Virtual Server. To set up a cluster, you can follow the steps in the Learning path: Deploying Red Hat OpenShift Container Platform 4.x on IBM Power Systems Virtual Servers.

Estimated time

It takes approximately around 1 hour to set up Red Hat Advanced Cluster Management for Kubernetes on IBM Power Systems Virtual Server.

Steps

  1. Install Red Hat Advanced Cluster Management for Kubernetes on Power
  2. Import the cluster in to your Red Hat Advanced Cluster Management for Kubernetes console (optional)
  3. View your managed clusters
  4. Deploy an application
  5. Deploy a policy

1. Install Red Hat Advanced Cluster Management for Kubernetes on Power

First, you want to install Red Hat Advanced Cluster Management for Kubernetes on top of your OpenShift Container Platform cluster. Red Hat Advanced Cluster Management for Kubernetes is easily installed using the OperatorHub. For detailed installation instructions see the Red Hat Advanced Cluster Management for Kubernetes installation documentation.

To open the Red Hat Advanced Cluster Management for Kubernetes console, from the OpenShift Container Platform console of your cluster, click the matrix icon at the upper-right side and click Red Hat Advanced Cluster Management for Kubernetes.

Figure 1
View larger image

2. Import the cluster in to your Red Hat Advanced Cluster Management for Kubernetes console (optional)

When you install Red Hat Advanced Cluster Management for Kubernetes on a cluster, the local cluster is automatically imported in to Red Hat Advanced Cluster Management for Kubernetes. So, you have at least one cluster managed with Red Hat Advanced Cluster Management for Kubernetes. This step is only necessary if you want to manage multiple clusters. You can import additional clusters to Red Hat Advanced Cluster Management for Kubernetes by following the import a target cluster documentation.

3. View your managed clusters

At this point of the tutorial, you have a Red Hat Advanced Cluster Management for Kubernetes instance running on your hub cluster and one or more clusters managed with Red Hat Advanced Cluster Management for Kubernetes. To see your managed clusters from the console, in the left panel, click Infrastructure → Clusters.

Figure 2
View larger image

The number of entries in the cluster tab can vary depending on the number of clusters you have imported.

4. Deploy an application

Now that you have clusters managed with Red Hat Advanced Cluster Management for Kubernetes, you want to deploy applications on it. In this tutorial, as an example, you are going to deploy Pacman using Red Hat Advanced Cluster Management for Kubernetes. To achieve this, use the resources in the open-cluster-management Git repository. In your Red Hat Advanced Cluster Management for Kubernetes console, click Applications → Create application.

Figure 3
View larger image

Populate the name and namespace fields with the required values. For the repository type, choose Git as this is where your Pacman application is stored. In the URL section, enter the Git path to your Pacman application (https://github.com/REPO_FORK_NAME/open-cluster-management; replace <REPO_FORK_NAME> with the actual forked repository name; note that you don’t need to fork the repository if you don’t plan to change the application in the subsequent steps).

  • Username and Access token fields are useful if your Git repository is a private repository.
  • Branch and Commit hash fields are useful if you want to specify special versions or files that you want to deploy from your Git repository.
  • Tag field is useful if you want to manage multiple application with fewer operations from Red Hat Advanced Cluster Management for Kubernetes.
  • Reconcile option and Repository reconcile rate fields are useful if you want special conditions to update your application when you Git repository is updated.
  • Deployment time windows field is useful if you want your application to be running during specified periods of time.

You can leave all of the above fields empty or with the default value.

In the Path field, enter application-samples/pacman to deploy only what is in the pacman folder of your Git repository. For the Select clusters to deploy to field, select the local-cluster checkbox. Then confirm the configuration by clicking Save. If you have issues deploying the application, you can follow the instructions at: https://github.com/ocp-power-demos/open-cluster-management/blob/main/application-samples/pacman/README.md

After the application is created, you are redirected to the overview page of your application. The deployment of your application can take a few minutes. When it is done, you see that your application has been deployed to the local cluster. Notice that at the bottom of the overview page, there is the topology where you see all the resources of your application. To test your Pacman application from the topology, click the route resource and then click Launch Route URL. Enjoy!

Figure 4
View larger image

To see the efficiency of this deployment solution, we are going to perform a simple manipulation: from your forked repository, go to application-samples/pacman/pacman-deployment.yaml and under spec/template/spec/containers/image, change the tag of the image. Change the current image from quay.io/powercloud/nodejs-pacman-app:latest to quay.io/powercloud/nodejs-pacman-app:green. Now, go back to your Pacman application and wait for 60 seconds or click Sync.

Figure 5
View larger image

Click Launch Route URL again. Notice that you just changed the background colour of your deployed application without any interruption of your service in less than 5 minutes!

5. Deploy a policy

Policies are used to identify and minimize risks. Use policies to define rules and set controls. You can learn more about policies by reading the Red Hat Advanced Cluster Management for Kubernetes Governance documentation.

To deploy a policy from your Red Hat Advanced Cluster Management for Kubernetes console, in the navigation panel, click Governance and then click the Create policy button.

Figure 6
View larger image

On the left side of the console, you can see the YAML definition of your future policy. Replace the content of the YAML file of the console with the content of the Git file (policy-collection/CM-Configuration-Management/policy-deployment-pacman.yaml) from your forked repository. Then, click Create. You are redirected to the Governance tab where you can see your new policy. Now, your Pacman deployment is being watched by the policy you just deployed. The policy informs you that this resource is up and running for every cluster with the pacman-demo=true tag!

Summary

This tutorial explained how to deploy Red Hat Advanced Cluster Management for Kubernetes on an OpenShift Container Platform cluster and how to import other clusters (including clusters that span multiple hardware platforms such as, Power, IBM Z, and x86) and hybrid cloud infrastructures. You observed the ease with which you can deploy an application and change it without any interruption of service. You secured your application by deploying a policy in the namespace of the application.

There are several other features that you can explore with Red Hat Advanced Cluster Management for Kubernetes on Power and multiple resources that can help you. For example, using the APIs, you can integrate the Advanced Cluster Management for Kubernetes interface in your own application running on your OpenShift Container Platform cluster managed by Advanced Cluster Management for Kubernetes on Power.

To deepen your knowledge, you can start with the Red Hat Advanced Cluster Management for Kubernetes technical documentation. Enjoy!

Legend