Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Lightweight Microservice blue-green deployment

Lightweight Microservice blue-green deployment

Talk from Phil Lombardi at Boston DevOps meetup 3/23/2016

Boston DevOps

March 25, 2016
Tweet

More Decks by Boston DevOps

Other Decks in Technology

Transcript

  1. • Philip Lombardi - Captain of the Cloud @ Datawire.io

    • Datawire is building open source developer tools and infrastructure for teams adopting / scaling microservices • We use a microservice architecture for our admittedly early system right now. • Build and deploy services quickly using Travis-CI, Packer, Terraform and AWS w/ blue-green releases.
  2. • Methodology for updating an app or service with zero

    downtime. • Ensures high-availability. • Ensures a rollback path is preserved (just in case). • Easy to reason about and the tooling is simple. • Often implemented by switching LB backend records, but other strategies exist. Blue-Green who and what? Servers LB Servers
  3. Datawire Flow (simplified): Compile + Unit Tests More Tests Packer:

    Bake AMI Swap! Developer Query “current” Color Update Terraform Config (color, ami, cluster size) $terraform apply Verify new color. Downscale old color.
  4. Swapping in Detail LB Starting State (active blue) Service Cluster

    (size: 10) Service Cluster (size: 0) Launch Config (v: 1) Launch Config (v: 1)
  5. Swapping in Detail LB Upgrading: Replace Green Launch Config (active

    blue) Service Cluster (size: 10) Service Cluster (size: 0) Launch Config (v: 1) Launch Config (v: 2) Launch Config (v: 1)
  6. Swapping in Detail LB Upgrading: Scale up Green (active blue)

    Service Cluster (size: 10) Service Cluster (size: 10) Launch Config (v: 1) Launch Config (v: 2)
  7. Swapping in Detail LB Upgrading: Attach Green to LB (active

    blue + green) Service Cluster (size: 10) Service Cluster (size: 10) Launch Config (v: 1) Launch Config (v: 2)
  8. Swapping in Detail LB Upgrading: Monitor Service (active blue +

    green) Service Cluster (size: 10) Service Cluster (size: 10) Launch Config (v: 1) Launch Config (v: 2)
  9. Swapping in Detail LB Upgrading: Standby Blue (active green) Service

    Cluster (size: 10) Service Cluster (size: 10) Launch Config (v: 1) Launch Config (v: 2) “Standby” to allow blue to finish in-progress work
  10. Swapping in Detail LB Upgrading: Detach Blue (active green) Service

    Cluster (size: 10) Service Cluster (size: 10) Launch Config (v: 1) Launch Config (v: 2)
  11. Swapping in Detail LB Upgrading: Downscale Blue (active green) Service

    Cluster (size: 0) Service Cluster (size: 10) Launch Config (v: 1) Launch Config (v: 2)
  12. Questions or comments? Check us out: https://datawire.io … we’re hiring!

    Organization GitHub: https://github.com/datawire More about microservices: microservices.com Sample GitHub Repository: https://github.com/datawire/blue-green-example Email Address: [email protected]