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. Ensure they are installed and properly configured before proceeding.

Tool Reference

Red Hat OpenShift CLI

OpenShift Container Platform downloads page

git

Red Hat Cloud-native Development Workshop Prerequisites

Installing 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 the Install button.

devspaces tile 2
  • On the Install Operator page:

  • Select stable from the list of available Update Channel options.

  • Choose All namespaces on the cluster (default) as the installation mode.

  • Leave the default value of Installed Namespace as openshift-operators (Operator recommended).

  • 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 Create CheCluster.

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

  • Wait for the CheCluster deployment to finish. When it’s available, navigate to NetworkingRoutes, and open the DevSpaces route.

If the DevSpaces dashboard loads correctly, the installation was successful.

Installing 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 the Install button.

pipelines tile 2
  • On the Install Operator page:

  • Select pipelines-1.9 from the list of available Update Channel options.

  • Choose All namespaces on the cluster (default) as the installation mode.

  • Leave the default value of Installed Namespace as openshift-operators.

  • Set the Update Approval to Automatic.

pipelines tile 3
  • Click Install.

Installing 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 the Install button.

gitops 2
  • On the Install Operator page:

  • Select gitops-1.7 from the list of available Update Channel options.

  • Choose All namespaces on the cluster (default) as the installation mode.

  • Leave the default value of Installed Namespace as openshift-operators.

  • Set the Update Approval to Automatic.

gitops 3
  • Click Install.

Installing 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 server, and a SonarQube server.

We have an existing Spring application that we want to migrate to Quarkus in order to take advantage of the benefits provided by the supersonic subatomic Java framework!

We will be working with a modified and prepared 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.

For this workshop, we will use the version available here: https://github.com/aolle/openshift-cicd-demo/tree/cnd, specifically the cnd branch.

To install the CI/CD environment, clone that branch and run the installation script:

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

Verify that the environment has been installed correctly by opening the different service URLs and checking their landing pages. Confirm that two repositories are available in Gitea: quarkus-petclinic and quarkus-petclinic-config.

Default credentials (username/password) are 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