Blue/Green based Progressive Rollout Strategy - Rafay Product Documentation

Blue/Green

What Will You Do

In this section, you will setup the required resources to use progressive rollouts. You will create a custom add-on for Argo Rollouts and deploy it to your cluster through a blueprint. Argo Rollouts will be used to manage the deployment strategy for the progressive rollouts of the workloads. You will then setup a GitOps pipeline that will deploy and update a workload from a Git repository upon commit. A webhook from the Git repo commit will be used to trigger the pipeline.

Step 1: Create Namespace

You will now create a managed namespace from the controller for the Argo Rollout resources.

Step 2: Create Addon

In this step, you will create a custom cluster add-on from the Catalog. The add-on will then be used in a custom cluster blueprint.

Step 3: Create Blueprint

In this step, you will create a custom cluster blueprint which contains the previously created addon.

Step 4: Apply Blueprint

In this step, you will apply the previously created blueprint to the cluster. Applying the blueprint will install Argo Rollouts and the managed system ingress controller.

The blueprint will begin being applied to the cluster

After a short period of time, the blueprint will be applied to the cluster.

Step 5: Fork Git Repo

In this step, you will fork a git repository to your account. The forked repo will contain declarative specs for the workload resources used in this guide. A GitOps pipeline will be created later in this guide which will be triggered by commits to this repository.

Step 6: Add Repository

In this step, you will add the forked repository to the controller so that the controller can deploy resources from the repo.

Step 7: Create Workload

You will now create a test workload which will contain multiple resources. The workload will be used to demonstrate progressive rollout strategies.

This will deploy the workload on the cluster selected.

Step 8: Create Pipeline

The GitOps pipeline will be used to deploy/update workloads from the Git repository each time and update is made and committed to the repo.

Add Stage

A pipeline can have multiple stages, with completely different actions to model your desired workflows. In this exercise, we will test with a simple, single stage pipeline.

Add Trigger

A pipeline can be executed based on an "external trigger". For example, changes to the manifests in your Git repository. In this exercise, we will configure a trigger that will receive a webhook notification when specific files in your Git repository are modified.

You will now be presented with the webhook configuration details that you need to copy/paste to your GitHub repository. Once you complete this step, the GitOps pipeline will be configured to receive webhook notifications whenever the repository is updated in Git.

Setup GitHub Webhook

Activate Pipeline

By default, newly created pipelines start life in a deactivated state.

Step 9: Upgrade Workload

In this step, we will update the workload manifest in Git and see that the updates are applied to the application by the GitOps pipeline using the progressive rollout strategy.

First, you will access the application of the previously deployed workload.

for n in {1..1000}; do curl 127.0.0.1; sleep 1; done

You should see output similar to the following showing the version of the workload being served by the webserver application.

Version-1.0.0
Version-1.0.0
Version-1.0.0
Version-1.0.0
Version-1.0.0
Version-1.0.0
Version-1.0.0
Version-1.0.0
Version-1.0.0
Version-1.0.0
Version-1.0.0

Now, you will update the workload manifest in the repository and see that the workload is updated using a blue/green approach.

After a few seconds, you should see the output of the previously executed "for loop" command display the updated version number. This shows that the progressive rollout updated the image to a newer version.

Version-1.0.0
Version-1.0.0
Version-1.0.0
Version-1.0.0
Version-1.0.0
Version-1.0.1
Version-1.0.1
Version-1.0.1
Version-1.0.1
Version-1.0.1
Version-1.0.1

Recap

At this point, you have successfully setup a GitOps pipeline to enable progressive rollouts using Argo Rollouts.