HelmBlueGreenRoleSwitch

JFrog Pipelines Documentation

ft:sourceType
Paligo

The HelmBlueGreenRoleSwitch step flips the roles played by the Helm releases deployed by a HelmBlueGreenDeploy step.

This role switch can be used to either make a new release available to users or to roll back a previously published release.

Blue/Green Deployment Strategy

Blue/Green deployment is a strategy of releasing new software that uses two production environments, as identical as possible, that take turns on serving users requests while the other one is used to perform the final stage of testing.

The HelmBlueGreenDeploy step refers to those two environments as blue and green. Those environments can be either playing Idle or Live roles, depending on which environment the users' requests are being forwarded to. The environment that is currently handling user requests is considered Live while the other one is considered Idle. To rollout a new release, we first deploy it to the environment playing the Idle role. There we can validate the new version to check if it is good to become available to users. If that is true, we can flip the environment roles so the previously Idle environment becomes Live and starts to handle user requests, while the previously Live environment goes Idle. One of the main advantages of this strategy is that rolling back new releases is as easy as flipping the environments roles again.

Both blue and green environments are represented in the context of Helm as two individual releases that co-exist in the same namespace. The HelmBlueGreenDeploy step assign Idle or Live roles to those releases by creating copies of their public Services dedicated to each role. By doing that we can easily change the releases role by updating those Services to be a copy of the Services from a specific environment. Those role Services created by Pipelines can be used to provision additional entrypoint components like DNS Records, Ingress Rules or Service Meshes.

To implement the complete Blue/Green deployment strategy workflow, Pipelines provides three native steps:

  • HelmBlueGreenDeploy discovers from runtime which release is playing Idle role, deploys the chart to it and creates or updates Idle role Services.

  • HelmBlueGreenRoleSwitch discovers from runtime which release is playing each role and flips them by creating or updating the role Services.

  • HelmBlueGreenCleanup discovers from runtime which release is playing Idle role and uninstalls it.

The following topics provide more information on HelmBlueGreenRoleSwitch Pipeline steps: