3 ms·
This 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
by nunez 4y ago
This 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!