Blue–green deployment

Although blue–green deployment is similar to canary deployment, the difference is that instead of routinizing the percentage of traffic, two separate identical environments are used in parallel to mitigate the risks of introducing new versions of actions. To do this, we create a new environment named staging. The production environment is used for going live and the staging environment is used for new changes. We then switch the environments back and forth between staging and production.

With respect to OpenWhisk, we can achieve this by creating a new staging environment using Cloud Foundry spaces. Then we deploy the current release version of our actions into the blue (production) environment and redirect traffic using an alias to the blue environment. Then, after the new versions of the actions are developed, we deploy them to the green (staging) environment for testing. Once the results of the testing are satisfactory, we redirect all the traffic to the green (staging) environment, and it is made live. Then the new version is deployed to the blue version for testing.

In case where the performance degrades or the release is buggy, we roll back the blue (go live) version to the current version and redirect the traffic again to blue and green environment becomes staging.