Skip to content

Support for atomic multi-stage app deployments #20

@christianparpart

Description

@christianparpart

WIP

GOALS:

Add support for atomic deploys while retaining support for rolling deploys.

DEFINITION: "Rolling Deploy"

Upon redeploying a application cluster, the new application instances (tasks) are spawned within the existing cluster. Once a new task becomes healthy an old task is being terminated, leaving the cluster with two versions during the deployment phase. Only when all tasks have been fully replaced with the new deployed version, the app cluster is not mixing up responses anymore.

DEFINITION: "Atomic Deploy"

An atomic deploy for a load balanced cluster is where the newly deployed tasks are activated in the load balancer (/service discovery) once all tasks became haealthy. The LB will then replace all old task's endpoints with the new endpoints while current sessions are still allowed to complete. Only after that the old deployment is subject to be terminated.

Motivation

In current deployments, we see somm 5xx HTTP response status codes due to the fact that we're having rolling deployments, and we hope to reduce them with the atomic switch from an old to the new app cluster version.

Implementation

By default, we consider each application to be a blue app. We can additionally link a green app to the blue app with an application label.

  • blue: /production/frontend-webapp with label mmsd_atomic_deploy_suffix set to -green.
  • green: /production/frontend-webapp-green

Properties of Linked Applications

  • They must be the same application that only differ in functionality (such as feature or bug fixes)
  • The service discovery ports from the blue application will be used by mmsd to expose the active deployment, whether it is the blue or the green app.
  • The application that gets deployed the last is the active application.
  • mmsd will not update the apps load balancer configuration during the deployment of a linked application,

Notes

Now, when an application gets redeployed, mmsd is getting notified via the event bus by the time the deployment starts.

  • mmsd will update its local state and fetch all applications metadata, including the new mmsd_atomic_deploy_suffix and build an internal map of blue/green apps.
  • When the deployment of a linked application has completed with deployment_success, mmsd will reconfigure the load balancer to point to the latest deployment (blue or green).

Editorial Notes

  • the name of the label for linking two apps into one is not fixed. we can choose some better name, if any (OTOH: doesn't matter that much)
  • this ticket is work-in-progress and subject to drastic changes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions