Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 52,299
    • Issues 52,299
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,529
    • Merge requests 1,529
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #226994
Closed
Open
Issue created Jul 06, 2020 by Orit Golowinski@ogolowinskiDeveloper

Blue/Green Deployments for AWS ECS

Problem to solve

As a developer deploying to AWS ECS, I want to deploy using blue/green deployment method.

Intended users

  • Sasha (Software Developer)
  • Devon (DevOps Engineer)

User experience goal

The user should be able to switch between blue/green environments directly from GitLab and be able to visually see both environments and know which production is currently being used by the users.

Proposal

Leverage existing AWS infrastructure to accomplish this

Assumptions:

  • 2 target groups exist in the EC2 console - blue and green (can be created via AWS console or API).
  • The target groups are configured to the autoscaling groups.
  • There is a deployment group configured
  • There is a listener rule - forward to blue/forward to green created for each of the target groups

We need to add support to:

  • Build and push blue/green container images to the GitLab's package repository
  • Tag the images blue/green (or v1/v2)
  • ECS service for blue/green deployments

Option one - use forwarding rules:

  • Change the listener forwarding rule using the modify-rule API

When a user presses the Changes the weights of the deployments - the listener rule should be updated to the other environment

  • blue->green
  • green->blue

When the user uses quick action /switch the listener rule should be updated

Option two: -Swap the container images

  • Update Task Definition revision using green container image
  • Replace the Image with the secondary image (v2) URI
  • Update ECS service to use new Task Definition revision and trigger a new deployment

The user needs to know which environment/URL is currently blue and which is green

Further details

image

image forward Forward requests to the specified target groups. For more information, see Forward actions.

modify-rule

Description Replaces the specified properties of the specified rule. Any properties that you do not specify are unchanged.

To add an item to a list, remove an item from a list, or update an item in a list, you must provide the entire list. For example, to add an action, specify a list with the current actions plus the new action.

  modify-rule
--rule-arn <value>
[--conditions <value>]
[--actions <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Permissions and Security

Only users who have permission to deploy to production can switch environments

Documentation

Availability & Testing

What does success look like, and how can we measure that?

What is the type of buyer?

Is this a cross-stage feature?

Links / references

  • https://aws.amazon.com/blogs/containers/aws-codedeploy-now-supports-linear-and-canary-deployments-for-amazon-ecs/
  • https://aws.amazon.com/blogs/aws/new-application-load-balancer-simplifies-deployment-with-weighted-target-groups/
  • https://docs.aws.amazon.com/cli/latest/reference/deploy/create-deployment-group.html
  • https://github.com/aws-samples/aws-codedeploy-linear-canary-deployments-blog

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

Edited Mar 22, 2023 by 🤖 GitLab Bot 🤖
Assignee
Assign to
Time tracking