Jobstart Lightning Talk - Docker Cloud Meetup SF 05/25
-
Upload
michelle-antebi -
Category
Technology
-
view
2.109 -
download
2
Transcript of Jobstart Lightning Talk - Docker Cloud Meetup SF 05/25
![Page 1: Jobstart Lightning Talk - Docker Cloud Meetup SF 05/25](https://reader036.fdocuments.in/reader036/viewer/2022082906/58e967191a28abb45f8b64e3/html5/thumbnails/1.jpg)
Blue/Green DeploymentsAndrew E. Rhyne
Lead Engineer @ Jobstartgithub.com/thebigredgeek
![Page 2: Jobstart Lightning Talk - Docker Cloud Meetup SF 05/25](https://reader036.fdocuments.in/reader036/viewer/2022082906/58e967191a28abb45f8b64e3/html5/thumbnails/2.jpg)
– David Farley
“Releasing software is too often an art; it should be an engineering discipline.”
![Page 3: Jobstart Lightning Talk - Docker Cloud Meetup SF 05/25](https://reader036.fdocuments.in/reader036/viewer/2022082906/58e967191a28abb45f8b64e3/html5/thumbnails/3.jpg)
What is blue/green?• Two identical production environments called blue
and green
• At any time, only one of the two environments is active.
• Deployment occurs against the environment that is not active.
• After a successful deployment, the load balancer is switched to point to the previously not active environment.
• Active switches between blue and green with each rollout
• Zero downtime deployments
![Page 4: Jobstart Lightning Talk - Docker Cloud Meetup SF 05/25](https://reader036.fdocuments.in/reader036/viewer/2022082906/58e967191a28abb45f8b64e3/html5/thumbnails/4.jpg)
Why blue/green?• Requiring downtime to deploy a service is unnecessarily
painful.
• Blue/green deployment requires zero downtime in almost every case.
• With micro-services, zero-downtime deployments equates to less ops-level complexity.
• Docker Cloud & HAProxy provide abstraction that mitigates most of the complexity.
• Rollback doesn’t require a re-deploy. Simply scale back up the previously active cluster and switch HAProxy back over.
![Page 5: Jobstart Lightning Talk - Docker Cloud Meetup SF 05/25](https://reader036.fdocuments.in/reader036/viewer/2022082906/58e967191a28abb45f8b64e3/html5/thumbnails/5.jpg)
How to blue/green• Every service should be divided into 2 variant
clusters, blue and green, with HAProxy load balancing the active cluster
• On deployment, CI should deploy to the non-active cluster. I.e., when blue is active CI should deploy to green.
• Non-active cluster should be scaled up to active scale and health-checked. If the non-active cluster is healthy, HAProxy should be unlinked with the active cluster and linked with the non-active cluster, reversing the roles.
• Finally, previously active cluster is scaled down to 1 instance.
![Page 6: Jobstart Lightning Talk - Docker Cloud Meetup SF 05/25](https://reader036.fdocuments.in/reader036/viewer/2022082906/58e967191a28abb45f8b64e3/html5/thumbnails/6.jpg)
dockercloud/haproxy
org/service (blue - 3 containers)
org/service (green 1 container)
Before deployment
![Page 7: Jobstart Lightning Talk - Docker Cloud Meetup SF 05/25](https://reader036.fdocuments.in/reader036/viewer/2022082906/58e967191a28abb45f8b64e3/html5/thumbnails/7.jpg)
dockercloud/haproxy
org/service (blue - 3 containers)
org/service (green 3 containers)
During deployment
![Page 8: Jobstart Lightning Talk - Docker Cloud Meetup SF 05/25](https://reader036.fdocuments.in/reader036/viewer/2022082906/58e967191a28abb45f8b64e3/html5/thumbnails/8.jpg)
dockercloud/haproxy
org/service (blue - 1 container)
org/service (green 3 containers)
After deployment
![Page 9: Jobstart Lightning Talk - Docker Cloud Meetup SF 05/25](https://reader036.fdocuments.in/reader036/viewer/2022082906/58e967191a28abb45f8b64e3/html5/thumbnails/9.jpg)
Docker Cloud makes it easy
• Docker Cloud’s HAProxy image will “automagically” redirect traffic from old links to new links at run time.
• This means that developers don’t really need anything from DevOps to make this work.
![Page 10: Jobstart Lightning Talk - Docker Cloud Meetup SF 05/25](https://reader036.fdocuments.in/reader036/viewer/2022082906/58e967191a28abb45f8b64e3/html5/thumbnails/10.jpg)
Resolving the active color
• https://github.com/thebigredgeek/dcbg - Command line tool that returns the inactive color code using Docker Cloud’s REST API.