Blue Green Deployment

What is blue green deployment?

A blue/green deployment is a deployment strategy in which you create two separate, but identical environments. One environment (blue) is running the current application version and one environment (green) is running the new application version. Using a blue/green deployment strategy increases application availability and reduces deployment risk by simplifying the rollback process if a deployment fails. Once testing has been completed on the green environment, live application traffic is directed to the green environment and the blue environment is deprecated.

Example of blue-green deployment using operate command:

odin operate component --name my_application --service odindemo --operation redeploy --options='{"artifact_version": "1.0.0", "strategy": {"name": "blue-green"}' --env bluegreen

The above command deploys the my_application component for service odindemo in environment bluegreen using blue green deployment strategy

Options specific to blue green deployment

Option
Type
Description
Example

strategy

string

This field denotes the strategy you want to follow for a specific operation. Following are the available options:

  1. blue-green: Used for blue green deployment strategy.

  2. in-place: Refer to the In Place Deployment for the same.

canary

boolean

If this field is set to true, On the successful deployment, the traffic routing will be done in a canary fashion. Canary works in multiple phases,

Phase 1: 20% of traffic will be shifted to the new deployment, and odin will check for the 5XX errors if no errors are recorded, it will move to the next phase.

Phase 2: 100% of the traffic will be shifted to the new deployment, and odin will check for the 5XX errors if no errors are recorded, it will move to the next phase.

--options='{ "auto_routing" : true}'

canary_config

json

This is an optional field which will allow users to set error threshold value for Canary. Needless to say, this will be only applicable if canary is set to true.

Error threshold takes two parameters, both of which are mandatory if you are using canary_config:

  1. metric (string): Can take one of the two values Percent or Absolute.

  2. value (float): Signifies the percentage or absolute no. of errors for the threshold, as defined in metric.

--options='{"canary": true, "canary_config": {"error_threshold": {"metric": "percent", "value": 0.5}}}'

auto_routing

boolean

If this field is set to true, On the successful deployment, the traffic will be routed from the old active stack(old version) to the new active stack (new deployment version). And if this field is set to false, odin will not route traffic to the new deployment. Users will have to shift the traffic manually.

--options='{ "auto_routing" : true}'

passive_downscale

boolean

If this field is set to true, the passive stack will be downscaled once the deployment is successful.

--options='{ "passive_downscale" : true}'

If user does not pass any deployment strategy explicitly, by default, blue-green deployment strategy will be used for the operation.

Last updated