Blue/Green Deployment
  • 28 Mar 2024
  • Dark
    Light
  • PDF

Blue/Green Deployment

  • Dark
    Light
  • PDF

Article summary

Blue/Green Strategy in IAP

A Blue/Green deployment is a strategy in which you have two separate, but identical environments. This involves running both "old" and "new" versions of the application simultaneously in production. Blue is the old version, and Green is the new one. Users are migrated (moved) to the new application version (green) after it has been deployed to production.

Using a Blue/Green deployment strategy increases application availability and reduces deployment risk by simplifying the rollback process if a deployment fails. Deployments and upgrades can be staged in advance during normal business hours so end users are not interrupted. After users are moved to the new application version (green), the old version (blue) can act as a failover if code must be rolled back to the previous version due to bugs or critical errors. Moreover, changes made on the blue will never affect the green. This includes code running adapters and applications, database documents such as workflows, and configurations.

Blue/Green Architecture in IAP

Itential structures its Blue/Green deployment architecture with two IAP stacks defined as “Separate” and "Identical".

Separate IAP

An IAP that is “Separate” is defined as having a separate:

  • Logical database in MongoDB
  • Database in Redis

A “Separate” IAP does not interfere with the "Identical" IAP environment during the execution of automations.

Figure 1: Separate IAP (Blue)
Blue - Green image.jpg


Identical IAP

An IAP is “Identical” to another IAP if it has the same set of native resource models (defined below) in the MongoDB logical database. The database data required to make an "Identical" IAP is:

  • An iap_profiles document for both Green IAP and Blue IAP.
  • A service_configs document for both Green IAP and Blue IAP.
  • An identical set of native resource model documents.
  • An identical set of custom resource model documents owned by custom applications/adapters.

Native Resource Models

Each IAP in a Blue/Green deployment has a set of native resource models that configure IAP to work with automations and resource components to provide a consistent development and automated management experience. These include the following collections, but may also include custom collections from custom applications/adapters.

Collections

accounts
automations
catalog_store
component_groups
forms
groups
iap_profiles
iap_versioning
ids
integration_models
json_forms
mop_analytic_templates
mop_templates
rate_limit
roles
service_configs
tags
templates
transformations
triggers
ucm_compliance_reports
ucm_config_parsers
ucm_configs
ucm_golden_configs
ucm_json_specs
workflows

Blue/Green Deployment Process in IAP

You will need to create a Blue/Green environment using the process outlined below. This requires IAP release version 2023.1 and higher.

  1. Create a “Separate”, but “Identical” IAP using the desired new version of IAP. The new IAP will be referred to as "Green IAP" and the existing (old) IAP will be referred to as "Blue IAP".

    • Green IAP must have startJobs deactivated.
    • Green IAP must have Task Worker deactivated.
    • Green IAP must have an iap_profiles document.
    • Green IAP must have a service_configs document.
  2. Copy over all native resource models, including any running schema migrations.

  3. Start the Green IAP.

  4. Deactivate startJobs on Blue IAP.

  5. Activate startJobs and Task Worker on Green IAP.

  6. Point the Load Balancer or DNS at Green IAP.

  7. Once all jobs are completed on Blue IAP, deactivate Task Worker.

  8. Migrate any desired jobs and tasks and other automation execution data to Green IAP for record keeping or another secure location for archived data.


Figure 2: Blue/Green IAP
Figure 2


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.