3 ms·
Zero-Downtime Deployments with Docker Compose
- AdieuToLogic 4y ago"Blue-green deployment" seems to be another phrase for hot-warm installations which can use DNS-switching (or other means) for rollbacks. Or am I missing something? Still like the write-up, even if not using Traefik.
- fbdab103 4y agoBlue-green terminology was made famous by Martin Fowler in 2010 with this post[0]. [0] https://martinfowler.com/bliki/BlueGreenDeployment.html https://martinfowler.com/bliki/BlueGreenDeployment.html
- AdieuToLogic 4y agoThanks for the info/material, kind Internet person :-).
- nunez 4y agoThis is actually something that is easier and more scalable to do with Kubernetes, IMO. You would declare your app in a Kubernetes Deployment load balanced by a Kubernetes Service and configure to use the Traefik ingress controller. You would apply two deployments, one for the blue side and the other for the green side. You would use annotations for this. Initially, the Service will be configured to only front Pods that are on the blue side. Deploy the deployment. When you're ready to ship a new version of the app, build a new container image and push it into your container registry. Once that's done, update the green side with the new image, then update the Service to front green Pods instead of blue ones. The cutover will be immediate. Kubernetes also supports other deployment models, including a Rolling deployment, which allows you to slowly bleed traffic onto new versions while keeping the old version up and scaling down appropriately.
- JoshGlazebrook 4y agoCan all of this be done on a single machine though? For a small hobby project for instance, docker-compose can handle everything on a single machine. With Kubernetes, don't you need multiple nodes?
- nunez 4y ago100%. You can run Kubernetes on your computer with minikube, kind, or even Docker Desktop!
- pabe 4y agoThis is brilliant for smaller projects/ small teams that don't want to carry Kubernetes' overhead. Thanks a lot for the writeup! <3