DeployNow
Advanced Deployment Options

Canary Deployments

A canary deployment is a progressive rollout of an application that splits traffic between an already-deployed version and a new version, rolling it out to a subset of users before rolling out fully. You can choose randomly or a specific group of users and roll back if anything breaks. If everything works as intended, you can gradually add more users while monitoring logs, errors, and software health.

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 canary and add any specific configurable features you like.
  5. In your manifest/template, Configure the steps for your canary release rollout in spec.strategy.canary.steps

Example

A good sample app to show off this feature is the Argo Rollouts canary example manifest.

!!! note This sample app is a simple sample of Canary Deployments. You can further configure this example for more flexibility as required using the Argo Rollouts Docs

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

YAML


You can add a manual approval step as part of the release using pause: {}

Create an Argo App which points to this manifest:

Document image


Update to a new version of the app

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

Document image


When your Argo App is next synced, you will see the canary rollout. As per the configuration above, first 20% of the traffic will be sent to the blue pods, then the deployment will pause for 30s, then 20% more of the traffic will go to the blue pods (for a total weight of 40%) and so on until 100%.

Traffic split to canary pods is best-effort by default. For example: If you have 3 pods, and set weight of canary to 25%, rounding up will be done and 1 pod will serve the canary release while 2 will serve the stable release. For more fine-grained control over traffic, you can tie-in Argo Rollouts to your existing routing tools like Istio, Nginx, AWS ALB, Traefik etc. Use these docs for more details.

If you want to configure your Canary Release to have progressive rollout dependent on passing some preconfigured metrics, you can take a look at the Canary Deployments with Analysis docs.