Environment Setup

Prerequisites

During this tutorial, it will be required to work with different tools for running the exercises included. Please install the following software:

Tool Fedora macOS Windows Official Documentation

oc

Download

Download

Download

OpenShift CLI - Docs

git

Download

Download

Download

Git - Docs

Argo Rollouts CLI

Download

Download

Download

Git - Docs

Visual Studio Code

Download

Download

Download

Visual Studio Code - Docs

Please review the official documentation to install the latest versions of these tools on your laptop following the optimum procedure

It is also required to have a GitHub account in order to create some repositories during this tutorial.

Laboratory

The technical exercises included in this tutorial are based on cloud native solutions which are extensively used in the IT market. Please review the following list which includes the basics around these cloud native solutions:

  • GitHub is a provider of Internet hosting for software development and version control using Git. It offers the distributed version control and source code management functionality of Git, plus its own features.

  • Red Hat Openshift Container Platform Cluster is an enterprise-ready Kubernetes container platform with full-stack automated operations to manage hybrid cloud, multicloud, and edge deployments. Red Hat OpenShift is optimized to improve developer productivity and promote innovation.

  • ArgoCD is a declarative, GitOps continuous delivery tool for Kubernetes following the GitOps pattern of using Git repositories as the source of truth for defining the desired application state. Argo CD automates the deployment of the desired application states in the specified target environments. Application deployments can track updates to branches, tags, or pinned to a specific version of manifests at a Git commit.

  • Argo Rollouts provides advanced deployment capabilities such as blue-green, canary, canary analysis, experimentation, and progressive delivery features to Kubernetes.

  • Helm is a tool to find, share, and use software built for Kubernetes. Helm helps users manage Kubernetes applications in terms of definition, installing, and upgrading even the most complex Kubernetes applications.

During this tutorial, a set of resources are provided by the instructor in order to be able to complete the exercises described in the following sections. The main objective of these resources is to provide a platform, multiple templates and other resources which are required to create different objects in Openshift.

Please review the following list to have an overall understanding of the resources provided for completing this tutorial:

  • An Openshift cluster that will host and make available a set of applications

  • A set of dedicated namespaces per user in the Openshift Cluster

  • An ArgoCD installation that allows attendees to deploy applications in a GitOps fashion

  • An Argo Rollouts installation that allows attendees to deploy applications using deployment strategies such as Blue/Green and Canary

  • A set of GitHub repositories that include the templates and automatisms required to deploy a group of applications

Parameters

The instructor provides the users with the necessary Openshift credentials and other important parameters at the beginning of this tutorial to access and complete the laboratory.

The following table includes the parameters that the instructor should provide you at the beginning of the laboratory:

Name Value

Openshift Cluster API (Access CLI)

https://api.%CLUSTER%:6443

Openshift Cluster Console

https://console-openshift-console.apps.%CLUSTER%

Openshift Domain

%CLUSTER%

Username

%USER%

Password

%USER%

App Namespace GitOps

%USER%-gitops-argocd

App Namespace for Blue-Green deployment

%USER%-blue-green

App Namespace for Canary deployment

%USER%-canary

App Namespace for Canary deployment with Service Mesh

%USER%-canary-service-mesh

ArgoCD console

https://argocd-server-%USER%-gitops-argocd.apps.%CLUSTER%/

Service Mesh Prometheus Password

*Review parameters table provided by the instructor

Access - OCP Console

In order to check the laboratory environment, please access the Openshift Console via browser using your credentials:

ocp console
Figure 1. Openshift Console
Use lab-users section to log in with your credentials.

Access - OC Client

The OpenShift Container Platform CLI (which needs to be installed first) exposes the commands for managing your applications as well as the lower-level tools to interact with each component of your system. With the oc command, you can create applications and manage OpenShift Container Platform projects from a terminal.

Please check that you have followed the pre-requisites with your instructor and connect to the cluster executing the next command from your terminal:

oc login -u %USER% -p %USER% https://api.%CLUSTER%:6443

If the login is successful, it should show an output similar to the following screenshot:

OC CLI Login Output
Figure 2. OC CLI Login Output
Please pay special attention to oc CLI because you will need to use this tool several times during this tutorial.

As shown in the output, the user will have access to the following namespaces:

  • %USER%-gitops-argocd: It contains Argo CD installation and all the GitOps objects.

  • %USER%-blue-green: It will contain the application using Blue/Green deployment.

  • %USER%-canary: It will contain the application using Canary deployment.

  • %USER%-canary-service-mesh: It will contain the application using Canary deployment with Service Mesh.

Each user will have its own four namespaces.

Access - Argo CD dashboard

The Argo CD web console will give you access to control how the git repo is synced with Openshift, as well as check the real status of the synchronization. To log in to the web console, access to https://argocd-server-%USER%-gitops-argocd.apps.%CLUSTER%/

It is important to bear in mind that Argo CD upon installation generates an initial admin password which is stored in a Kubernetes secret. In order to retrieve this password, run the following command to decrypt the admin password:

oc extract secret/argocd-cluster -n %USER%-gitops-argocd --to=-

Log into Argo CD with admin username and the password retrieved from the previous step.

ArgoCD login screen
Figure 3. ArgoCD login screen

If the login is successful, you will see the home screen where your applications will be created.

ArgoCD applications
Figure 4. ArgoCD applications

Argo Rollouts Kubectl plugin

Argo Rollouts offers a Kubectl plugin to enrich the experience with Rollouts, Experiments, and Analysis from the command line. It offers the ability to visualize the Argo Rollouts resources and run routine operations like promoting or retrying on those resources from the command.

Install it using the official documentation. Then, check that the plugin is correctly installed using the following command:

$ oc argo rollouts list rollouts
No resources found.
If the previous command shows something like Error: unknown command "argo" for "oc", please recheck your installation.

Clone the GitOps repository

Following the GitOps practices, all the deployment configuration is stored in the git repo. We have created an initial repository that you will change to configure your deployment. As part of the demo, you will have to do some changes and commits.

Please fork the repository and clone it in your local machine to have full autonomy to make changes and deploy applications. In order to complete this task, follow the next steps:

  • Access the workshop-argo-rollouts-resources repository.

  • Fork it on your GitHub account. If prompted, choose to fork only the main branch.

  • Clone the repository to your local machine. You can use both SSH and HTTPS URLs. If you have already configured your SSH keys, use this mechanism. If not, use HTTPS.

git clone https://github.com/change_me/workshop-argo-rollouts-resources
cd workshop-argo-rollouts-resources

Cluster Setup

The cluster is already set up, so you do not need to follow the steps in this section. However, save the following link if you want to recreate this workshop in your own Openshift cluster.

Please visit Openshift Cluster Setup for more information about setting up an Openshift cluster in order to run this workshop.