Skip to main content
Version: Release 23.1

Progressive Delivery Using Release and Argo Rollouts

Before You Begin

This how-to involves working with a variety of tools and technologies such as Digital.ai Release, Argo Rollouts, GitHub, Digital.ai Release templates as code (.xlr files), Amazon EKS, kubectl, and so on. You can perform this task by simply following the instructions. However, being familiar with these tools and technologies can help you considerably when you try this out in your test environment.

To know more about Amazon EKS and Argo Rollouts, see:

What's the objective?

The objective is to illustrate:

  • how you can carry out Blue-Green and Canary deployments of an application (the Guestbook application in this how-to) to an Amazon EKS cluster using Digital.ai Release and Argo Rollouts.
  • the release management and deployment capabilities of Digital.ai Release and Argo Rollouts respectively.

Digital.ai Release integrates with Argo Rollouts and supports the following roll out strategies:

  • Blue-Green
  • Canary

Once you have this setup in place, all you would be doing is starting a new release—Canary or Blue-Green—whenever you have a new image to deploy.

note

Though the Digital.ai Release's Argo Rollout plugin supports all popular cloud platforms such as Amazon, GCP, Azure, and so on, this how-to is based on Amazon EKS for illustrative purposes.

What do you need?

You need the following to set up a Canary/Blue-Green deployment pipeline:

What do you have?

This how-to has been built with an example GitHub how-to repository that hosts the following:

  • Digital.ai Release templates:
    • Argo_Rollouts_Initial_BlueGreen_Rollout_Setup.xlr
    • Argo Rollouts_ BlueGreen Deployment.xlr
    • Argo_Rollouts_BlueGreen_Rollout_Teardown.xlr
    • Argo_Rollouts_Initial_Canary_Rollout_Setup.xlr
    • Argo_Rollouts_ Canary Deployment.xlr
    • Argo_Rollouts_Canary_Rollout_Teardown.xlr
  • Kubernetes deployment manifest files:
    • guestbook-bluegreen-rollout.yaml
    • guestbook-bluegreen-service.yaml
    • guestbook-canary-rollout.yaml
    • guestbook-canary-service.yaml
    • redis.yaml

This how-to illustrates how you can deploy the Guestbook application following the Blue-Green and Canary deployment strategies.

How does it work?

Here's a high-level overview of what you would do to set this up and what happens when you start a new Blue-Green or Canary deployment of an image.

At the end of this exercise you would have:

  • forked the xebialabs-community/howto GitHub repository and cloned the same to your Digital.ai Release server.
  • installed and configured Digital.ai Release 22.2.0 (or later).
  • installed the xlr-argo-rollouts-integration and xlr-kubernetes-plugin plugins.
  • created and configured an Amazon EKS cluster.
  • installed Argo Rollouts on the Amazon EKS cluster.
  • installed and configured a Linux host with Kubectl and Kubectl plugin for Argo Rollouts.
  • set up connections between the DIgital.ai Release and Kubectl host.
  • set up connections between the DIgital.ai Release and Argo Rollouts.
  • created Release global variables and imported the Release templates.

Once you have the setup in place, you must start a new release to set up the environment for Blue-Green and Canary deployments using the following templates.

  • Argo_Rollouts_Initial_BlueGreen_Rollout_Setup.xlr—Use this template to:
    • Create a namespace—guestbook-bluegreen.
    • Create two services—guestbook-bluegreen-active and guestbook-bluegreen-preview.
    • Create a rollout—guestbook-bluegreen-rollout—using the Blue-Green strategy with a replica set of two pods with the image guestbook:blue.
    • Create a redis pod and a redis service.
  • Argo_Rollouts_Initial_Canary_Rollout_Setup.xlr—Use this template to:
    • Create a namespace—guestbook-canary.
    • Create two services—guestbook-stable and guestbook-canary.
    • Create a rollout—guestbook-canary-rollout—using the Canary strategy with a replica set of five pods with the image guestbook:blue.
    • Create a redis pod and a redis service.

Once the initial setup is complete, all it takes to deploy a new image of the Guestbook application is to start a new release with one of the following templates.

  • Argo Rollouts_ BlueGreen Deployment.xlr—Use this template to:
    • Check which version of the application is live at the moment and set a new image for deployment.
    • Test and promote or abort the new image for a Blue-Green rollout.
    • Roll out or abort the new image of the Guestbook application depending on whether you promoted or aborted the rollout.
    • Send notifications.
  • Argo_Rollouts_ Canary Deployment.xlr—Use this template to:
    • Check which version of the application is live at the moment and set a new image for deployment.
    • Test and promote or abort the new image for a Canary rollout.
    • Roll out or abort the new image of the Guestbook application depending on whether you promoted or aborted the rollout.
    • Send notifications.

Once you have had a trial run of the procedure you can use the following Release templates to remove all the namespaces, services and rollouts so that you can free up your cloud resources or start all over again from the scratch if you want.

  • Argo_Rollouts_BlueGreen_Rollout_Teardown.xlr—removes the namespace, service, rollout and so on for Blue-Green
  • Argo_Rollouts_Canary_Rollout_Teardown.xlr—removes namespace, service, rollout and so on for Canary

Here's a detailed step-by-step.

Step 1—Create an Amazon EKS Cluster

note

For illustrative purposes, this topic deals with Amazon EKS. You can have your Kubernetes cluster in other cloud platforms such as GCP or Azure too.

  1. Log on to your AWS account and gather the AWSAccessKeyId and AWSSecretKey.

    Create an access key if you do not have one already. For more information, see Managing access keys.

important

It is recommended to download and save the AWS access key file immediately after creating the access key as you cannot retrieve your Secret Access Key later.

  1. Create an Amazon EKS Cluster. For more information, see Creating an Amazon EKS cluster.

    While there are innumerable configurations possible for your EKS cluster, this topic assumes the EKS cluster is made up of a cluster with three nodes of instance type t2.medium

  2. Gather the following information about your Amazon EKS cluster and keep them handy.

    • Your Amazon account's AWSAccessKeyId and AWSSecretKey
    • The AWS region code (for example, eu-west-2) that hosts the EKS cluster
    • The EKS cluster's name
    • The API server endpoint URL
    • The Certificate Authority (CA) cert

Step 2-Install Argo Rollouts In Your Cluster

See Install Argo Rollouts.

Step 3—Install the AWS-LB Controller in the Amazon EKS Cluster

See Installing the AWS Load Balancer Controller.

Step 4—Set up the Kubectl Linux host

  1. Log on to the Linux host.

  2. Install Kubectl and the Kubectl plugin for Argo Rollouts.

    See:

  3. Connect the Kubectl host to the Amazon EKS cluster. See Update kubeconfig.

Step 5—Set up the Digital.ai Release Server and Fork the how-to GitHub Repository

  1. Log on to your Digital.ai Release server (Linux) as a root user.

  2. Install Digital.ai Release.

    Tip: If you want to install Release using Docker images:

  3. Start your Digital.ai Release server and log on.

  4. Install the following Release plugins.

  5. Fork the xebialabs-community/howto GitHub repository and clone the forked repository. Suppose you clone the repository to the your home directory (for example, /home/john).

Step 6—Set up Connections

Log on to the Digital.ai Release application and set up connections to the Kubectl host and Kubectl Argo Rollouts.

connections

Step 6.1—Set up Connection to the Kubectl Host

  1. Click Connections from the left navigation pane.

  2. Click the + icon next to Kubectl Host.

  3. Type the values for the following fields:

    • Title
    • Address (IP address of the Kubectl host)
    • Port
    • Username
    • Password or Private Key File (depending on what you use)

    kubectl host connection

  4. Click Test.

    kubectl host connection test

  5. Click Save.

Step 6.2—Set up Connection to the Kubectl Argo Rollouts

  1. Click Connections from the left navigation pane.

  2. Click the + icon next to Kubectl Argo Rollouts.

  3. Type the values for the following fields:

    • Title
    • Host
    • Local Kubeconfig
    • Context
    • Kubectl Path
    • Kubectl Argo Rollouts Path

    argo rollouts connection

  4. Click Test.

    argo rollouts connection test

  5. Click Save.

Step 7—Create Release Global Variables

  1. Click Global Variables from the left navigation pane.
  2. Click New global variable and create the following global variables.
Variable NameValueType
${global.blue-green.container-name}guestbook-containerText
${global.blue-green.current-image}xldevdocker/guestbook:greenText
${global.blue-green.rollout-name}guestbook-bluegreen-rolloutText
${global.canary.container-name}guestbook-containerText
${global.canary.current-image}xldevdocker/guestbook:blueText
${global.canary.rollout-name}guestbook-canary-rolloutText

Step 8—Import the Release Templates

  1. Click Folders > Add Folder and create the folders you need.

    create folders

  2. Import the Release templates from the xebialabs-community/howto GitHub repository that you forked. See Import a Release Template for more information.

    Templates for Blue-Green deployments

    blue-green templates

    Templates for Canary deployments

    canary templates

  3. After importing the templates, open the tasks in these templates and select the value for the Kubectl Conf and Rollouts Config fields as required.

    rollouts config field

    kubectl conf field

Step 9—Set up the Dashboard for Blue-Green and Canary Deployments

  1. Click Dashboards > Add custom dashboard from the left navigation pane.

  2. Type the name, description and so on for the dashboard.

    dashboard

  3. Click Add tiles and add ArgoRollouts Blue Green details and ArgoRollouts Canary details.

    add tiles

  4. Configure the tiles as shown in the following illustration and save the tiles.

    Blue Green tile

    blue green tile config

    Canary tile

    canary tile config

  5. Click Back to view mode to view the dashboard.

Step 10—Blue-Green Strategy—Initial Roll Out of the Guestbook Application

The following tasks are part of the Argo Rollouts: Initial Blue-Green Rollout Setup template.

  • Create a namespace—guestbook-bluegreen.
  • Create two services—guestbook-bluegreen-active and guestbook-bluegreen-preview.
  • Create a rollout—guestbook-bluegreen-rollout—using the Blue-Green strategy with a replica set of two pods with the image guestbook:blue.
  • Create a redis pod and a redis service.
  1. Go to the Folders > Blue-Green Deployment folder.

  2. Select the Argo Rollouts: Initial Blue-Green Rollout Setup template.

  3. Click New Release.

  4. Type a name for the new release, select a user for the Run automated tasks as user field and type the password.

    bg new release

  5. Click Create.

  6. Click Start release and click Start from the dialog box and have the initial rollout completed.

    bg initial rollout done

  7. Go to the dashboard and verify the initial rollout with two pods.

    bg initial rollout

  8. You can also go to the url

    to view the deployed Guest Book application (in blue).

    bg initial deployment browser view

Step 10.1—Roll out New Versions of the Guestbook Application Using the Blue-Green Strategy

The following tasks are part of the Argo Rollouts: Blue-Green Deployment template.

  • Check which version of the application is live at the moment and set a new image for deployment.
  • Test and promote or abort the new image for a Blue-Green rollout.
  • Roll out or abort the new image of the Guestbook application depending on whether you promoted or aborted the rollout.
  • Send notifications.
  1. Go to the Folders > Blue-Green Deployment folder.

  2. Select the Argo Rollouts: Blue-Green Deployment template.

  3. Click New Release.

  4. Type a name for the new release, select a user for the Run automated tasks as user field and type the password.

    bg roll out green

  5. Type the new image's tag in the New image to deploy field.

  6. Select Promote Rollout or Abort Rollout from the Action drop-down list.

  7. Click Create.

  8. Click Start release and click Start from the dialog box.

  9. Click the Confirm new image manual task, assign it to yourself and complete the task.

    confirm new image green

    deploy the green image

  10. Once you confirm the new image, and once the Set Image task succeeds, you can view the dashboard to know that the new image xldevdocker/guestbook:green has been rolled out as Revision 2 for you to preview.

    bg rollout in progress

  11. Assign the Run tests on xldevdocker/guestbook:green manual task to yourself and complete it.

    test done

  12. Assign the Confirm Promotion? manual task to yourself and either promote or abort the rollout.

    promote

    Wait for the rollout to complete.

    green roll out done

  13. Go to the dashboard and verify the new rollout (Revision:2) with two pods running as Stable, Active.

green rollout success

  1. You can also go to the url

    to view the deployed Guest Book application (in green).

    green in browser

Step 11—Canary Strategy—Initial Roll Out of the Guestbook Application

The following tasks are part of the Argo Rollouts: Initial Canary Rollout Setup release template.

  • Create a namespace—guestbook-canary.
  • Create two services—guestbook-stable and guestbook-canary.
  • Create a rollout—guestbook-canary-rollout—using the Canary strategy with a replica set of five pods with the image guestbook:blue.
  • Create a redis pod and a redis service.
  1. Go to the Folders > Canary Deployment folder.

  2. Select the Argo Rollouts: Initial Canary Rollout Setup template.

  3. Click New Release.

  4. Type a name for the new release, select a user for the Run automated tasks as user field and type the password.

    canary new release

  5. Click Create.

  6. Click Start release and click Start from the dialog box and have the initial setup completed.

    canary initial rollout done

  7. Go to the dashboard and verify the initial rollout with five pods.

    canary initial rollout

  8. You can also go to the url

    to view the deployed Guest Book application (in blue).

    canary initial deployment browser view

Step 11.1—Roll out New Versions of the Guestbook Application Using the Canary Strategy

The following tasks are part of the Argo Rollouts: Canary Deployment template.

  • Check which version of the application is live at the moment and set a new image for deployment.
  • Test and promote or abort the new image for a Canary rollout.
  • Roll out or abort the new image of the Guestbook application depending on whether you promoted or aborted the rollout.
  • Send notifications.
  1. Go to the Folders > Canary Deployment folder.

  2. Select the Argo Rollouts: Canary Deployment template.

  3. Click New Release.

  4. Type a name for the new release, select a user for the Run automated tasks as user field and type the password.

  5. Type the new image's tag in the New image to deploy field.

  6. Select Promote Rollout or Abort Rollout from the Action drop-down list.

  7. Click Create.

    canary rollout green

  8. Click Start release and click Start from the dialog box.

  9. Click the Confirm new image manual task, assign it to yourself and complete the task.

    confirm image

  10. Once you confirm the new image, and once the Set Image task succeeds, you can view the dashboard to know that the new image xldevdocker/guestbook:green has been rolled out (to 20% weight and paused) as Revision 2.

    1662378278982

  11. Assign the Run tests on xldevdocker/guestbook:green manual task to yourself and complete it.

    test done

  12. Assign the Confirm Promotion? manual task to yourself and either promote or abort the rollout.

    promote green

    Wait for the rollout to complete.

  13. Go to the dashboard and verify the new rollout (Revision:2, Stable) with five pods.

    canary deployment success

  14. You can also go to the url

    to view the deployed Guest Book application (in green).

    green in browser

Step 12—Set up Linkerd

You can also set up Linkerd to observe the deployments, traffic splits, and analyze the data.

Once you have Linkerd set up, use the linkerd viz dashboard & command to view the pods and traffic splits.

Linkerd 1

Linkerd 2

Linkerd 3