DeployNow
Advanced Deployment Options

Blue Green Deployments

Blue Green deployments allow the next version (let's call it preview) of your application to be in the same environment as your active version for some time - until all your sanity checks are approved and you "promote" the preview to active

Getting Started

There are five core steps to support a Blue Green deployment for an existing Kubernetes Deployment:

  1. Ensure your target (destination) Kubernetes cluster(s) have the Argo Rollouts controller installed (see Install DeployNow Agent for more info)
  2. In your manifest/template, replace kind: Deployment to kind: Rollout
  3. In your manifest/template, replace apiVersion: apps/v1 to apiVersion: argoproj.io/v1alpha1
  4. In your manifest/template, replace spec.strategy with blueGreen and add any specific configurable features you like.
  5. To support a preview service, add a kind: Service which is identical to your current "active" service, but change the name.

Example

A good sample app to show off this feature is from the Argo Rollouts blue-green example manifests.

Say we have a manifest, rollout-bluegreen.yaml, like so:

YAML


Note the extra preview Service and the app set to image: argoproj/rollouts-demo:blue.

Create an Argo App which points to this manifest:

Document image


Since this is the initial rollout, notice how nothing is suspended and active is pointing to green

Document image


Port forwarding the active service shows green:

Shell

Document image


Everything is as expected.

Update to a new version of the app

Now, let's update our Git repo to change the version from green to blue:

Document image


When your Argo App is next synced, notice how it gets in a Suspended state:

Document image


This simply means there's a new version of your app, and your current active service will still be pointing to the original version until you promote.

This is proven by port-forwarding both of the services and checking:

Shell

Document image

Shell

Document image


The preview service can be sanity checked until you are ready to promote it to active.

Promote the new app version to active

When you are ready to promote the preview to active, you may click on Promote-Full of the rollout:

Document image


At this point, the argo-rollouts controller will ensure that all replicas of the pod have the preview pods promoted and the active service will route traffic to that pod.

We can confirm this by looking at the active service (which should now be "blue"):

Text

Document image