Skip to content

Blue/Green deployment with Cloudoor Deploy

This deployment model releases two versions of the application simultaneously in production environments:
- The first, Blue, is unchanged and is automatically deployed on the market.
- The second, Green, is available for review by internal teams but remains offline.

It is up to you to choose the right moment to release the Green (new) version with the freedom to roll back to the Blue (old) Version.

For example, you can deploy a new version on your production environment without exposing it to the general public.

This means that the staging version would be production-ready, and you can choose the ideal moment to switch the flow to the new version quickly or cancel it if you don't trust the version.

Deploying the Blue/Green Strategy from Cloudoor UI

We can also deploy the and manage the Blue/Green Deployment through the Cloudoor UI.

Head on to Deploy

You’ll see all workloads. Simply tap the workload you want to edit.

Here, you can find the API Gateway IP. Monitor the Success Rate, Latency and the Requests per min of the Live and Staging versions of your application. And visit either versions using the url in front of the version.

Click “Strategy” and choose Blue/Green from the Dropdown.

Deploying the New version

You can also choose the new version of your application by scrolling down and choosing the version you want from the dropdown in “Staging”.

Switching - Going Live with Cloudoor UI

When you're completely satisfied with the new version of your application and you wish to push it live. Select Switch.

You can switch your versions at the click of the toggle button, and click confirm.

Voila! You have successfully switched your version.

Using the Blue-Green Strategy from DOOR

Run this command to use the blue/green strategy:

door deploy workload <workloadName> --strategy blue/green --project project_name --env <environmentName>

There will be two versions of the application running.
One contains the live version, and the other the staging version.

door get workload --project <ProjectName> --environment <EnvironmentName>

The result should look like this:

NAME STRATEGY REPLICAS IMAGE AUTO-DEPLOY LIVE STAGING
workload Name blue/green replicas Number username/workloadName true/false 1.0.0 1.0.0

Now we have the same version on the live and the staging version

Deploying New Version with DOOR

We can deploy version 3.0.0 with this command:

door deploy workload <workloadName> --version 3.0.0

Now the staging deployment will contain version 3.0.0 and the live version with 2.0.0

door get workload -e <environmentName> -p <projectName>
NAME STRATEGY REPLICAS IMAGE AUTO-DEPLOY LIVE STAGING
workload Name blue/green replicas Number username/workloadName true/false 2.0.0 3.0.0

We can check if Cloudoor redirected the flow to the live version with this command:

curl -w "\n" http://localhost:8080
Result Example:
version 2.0.0

Going Live With DOOR

Run the following command to make the staging version live:

door deploy workload <workloadName> --go-to-live -e <environmentName> -p <projectName>

From now, Cloudoor will switch live and intermediate deployment. The live deployment contains version 3.0.0 and staging 2.0.0.

door get workload -e <environmentName> -p <projectName>
NAME STRATEGY REPLICAS IMAGE AUTO-DEPLOY LIVE STAGING
workload Name blue/green replicas Number username/workloadName true/false 3.0.0 2.0.0

Cloudoor redirected the flow to version 3.0.0.

curl -w "\n" http://localhost:8080
Result Example:
version 3.0.0