Odin
  • Introduction
  • Why Odin?
  • Key Concepts
    • Environment
      • Environment Type
    • Provisioning
      • Provisioning Config for Component Types
    • Component
      • Available Component Types
      • Component Type reference
        • Optimus Components
          • Aerospike [6.3.0.7-1.0.0]
    • Service
      • Know Your Service Definition
    • Versioning
      • Clearing the Confusion: A Simplified Guide to Artifact, Component, and Service Versions
    • Service Sets
    • Labels
  • Reference
    • CLI reference
  • Onboard Your Service
    • Installation
    • Configure
    • Odin -h
    • Getting Started
    • Create Environment
      • Operations on Environment
    • Service Definition
    • Provisioning Config
    • Deploy Service
    • Release Service
    • Optimus Datastore Operations
      • How to use Optimus Datastore in my service?
      • RDS Operations
      • Aerospike Operations
      • Kafka Operations
    • Operating Service & Components
      • Redeploy
        • In Place Deployment
        • Blue Green Deployment
      • Rolling Restart
      • Adding & removing components
      • Revert a deployment for application component
      • Downscaling a Passive Stack
      • Updating the no. of stacks of application component
    • Dev <> QA iteration
    • Frequently Asked Questions
    • Deploy Concrete Service
    • Undeploy Service
    • Delete Environment
    • Appendix
  • How To
    • Define error threshold for canary deployment
    • Add or Remove a component in an already deployed service
    • Integrate mono-repo(cronjobs) with Odin
    • Deploy crontab with Odin
    • Integrate Data pipeline with Odin
    • Push logs to log central
    • Build artifacts for multi module applications
    • Load test with Odin
    • Track Deployments against Commit Ids
    • Deploy Service on Production - Dream11
    • How and when images are created
    • Check logs for deployed infrastructure - Dream11
    • Onboard Stepfunction as a component
    • Onboard Serverless as a component
    • Login to Kubernetes clusters
  • Release Notes
    • 1.2.0-beta.2 - 11 August, 2022
    • Odin October Release
    • Odin 1.2.0 - Nov 9th 2022
    • Odin February Release
Powered by GitBook
On this page
Export as PDF
  1. Onboard Your Service
  2. Operating Service & Components
  3. Redeploy

Blue Green Deployment

PreviousIn Place DeploymentNextRolling Restart

Last updated 1 year ago

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 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.

In Place Deployment
Refer to Example