Environment Setup

This tutorial was developed and tested with:

  • Red Hat OpenShift 4.11.30

  • Red Hat OpenShift Dev Spaces 3.4.0

  • Red Hat OpenShift Pipelines 1.9.2

  • Red Hat OpenShift GitOps 1.7.2

Workshop Tools

The following tools are required to run the exercises in this tutorial. Please ensure that they are installed and properly configured before proceeding with any of the tutorial chapters.

Tool Reference

Red Hat OpenShift CLI

OpenShift Container Platform downloads page

git

Red Hat Cloud-native Development Workshop Prerequisites

Red Hat OpenShift Dev Spaces

You can use the Red Hat OpenShift Container Platform web console to install Red Hat OpenShift DevSpaces by following these steps:

  • Open a browser window and log in to the Red Hat OpenShift Container Platform web console.

  • From the Administrator perspective, click on Operators and then select OperatorHub.

  • In the Filter by keyword field, type devspaces.

devspaces tile 1
  • Select the Red Hat OpenShift Dev Spaces tile and click Install button.

devspaces tile 2
  • On the Install Operator page, select stable from the list of available Update Channel options, and then choose All namespaces on the cluster (default). Leave the default value of Installed Namespace as openshift-operators(Operator recommended), and set the Update Approval to Automatic.

devspaces tile 3
  • Click Install.

Once the operator installation finishes, create a project named demo-devspaces and deploy a CheCluster by following these steps:

  • From the Administrator perspective, click on Installed Operators.

  • Select Red Hat OpenShift Dev Spaces.

che 1
  • Click on Red Hat OpenShift Dev Spaces instance Specification, select Current namespace only and then click on Create CheCluster.

che 2
  • Set a desired name for the CheCluster, for example devspaces, and click on Create.

  • Wait for the CheCluster deployment to finish. When it’s available, navigate to Networking, then Routes, and open the devspaces route.

If the DevSpaces dashboard loads correctly, it means that the installation process went without any issues.

Red Hat OpenShift Pipelines

You can use the Red Hat OpenShift Container Platform web console to install Red Hat OpenShift Pipelines by following these steps:

  • Open a browser window and log in to the Red Hat OpenShift Container Platform web console.

  • From the Administrator perspective, click on Operators and then select OperatorHub.

  • In the Filter by keyword field, type openshift pipelines.

pipelines tile 1
  • Select the Red Hat OpenShift Pipelines tile and click Install button.

pipelines tile 2
  • On the Install Operator page, select pipelines-1.9 from the list of available Update Channel options, and then choose All namespaces on the cluster (default). Leave the default value of Installed Namespace as openshift-operators, and set the Update Approval to Automatic.

pipelines tile 3
  • Click Install.

Red Hat OpenShift GitOps

You can use the Red Hat OpenShift Container Platform web console to install Red Hat OpenShift GitOps by following these steps:

  • Open a browser window and log in to the Red Hat OpenShift Container Platform web console.

  • From the Administrator perspective, click on Operators and then select OperatorHub.

  • In the Filter by keyword field, type openshift gitops.

gitops 1
  • Select the Red Hat OpenShift GitOps tile and click Install button.

gitops 2
  • On the Install Operator page, select gitops-1.7 from the list of available Update Channel options, and then choose All namespaces on the cluster (default). Leave the default value of Installed Namespace as openshift-operators, and set the Update Approval to Automatic.

gitops 3
  • Click Install.

CI/CD Environment

In this section, we will deploy all the components of the CI/CD environment. The environment is composed of a Gitea git server, a Sonatype Nexus and a SonarQube server.

We have an existing Spring application that we want to migrate to Quarkus because we are interested in taking the advantatge of the benefits provided by the supersonic subatomic Java framework!

We will be working with a modififed, prepared, and adapted version of the CI/CD Demo with Tekton and Argo CD on OpenShift, created by Siamak Sadeghianfar and contributors. The original repository is available here: https://github.com/siamaksade/openshift-cicd-demo.

However, for this workshop, we will be using a version available here: https://github.com/aolle/openshift-cicd-demo/tree/cnd, specifically in the cnd branch.

To install the CI/CD environment, simply clone that branch and proceed as follows:

git clone -b cnd https://github.com/aolle/openshift-cicd-demo.git
./openshift-cicd-demo/demo.sh install
Make sure that you have already logged in into your OpenShift cluster before executing the commands. Additionally, make a note of the URLs of the services that the installation script provides.

Verify that the environment has been installed without any issues by opening the different URLs and checking the login and the landing pages. Check that we have two repositories avabilable in Gitea: quarkus-petclinic and quarkus-petclinic-config.

The list of the default credentials (username / password) is as follows: Gitea: gitea / openshift | Sonatype Nexus: admin / admin123 | SonarQube: admin / admin | Argo CD: login with OpenShift credentials

Gitea git server

gitea

Sonatype Nexus

nexus

SonarQube

sonar

Argo CD

argocd