Blue-green deployment is a deployment strategy where we have two identical environments running one hosting the current (blue) version of our application, and the other running the new (green) version.
When itโs time to release, we simply switch traffic from blue โ green. If something goes wrong, we can roll back instantly by sending traffic back to blue.
But hereโs the big question:
๐๐ผ๐ ๐ฑ๐ผ ๐๐ฒ ๐ฎ๐ฟ๐ฐ๐ต๐ถ๐๐ฒ๐ฐ๐ ๐๐ต๐ถ๐ ๐ถ๐ป ๐๐ต๐ฒ ๐ฟ๐ฒ๐ฎ๐น ๐๐ผ๐ฟ๐น๐ฑ ๐๐ต๐ฒ๐ป ๐๐ฒ ๐ป๐ฒ๐ฒ๐ฑ ๐ต๐ถ๐ด๐ต ๐ฎ๐๐ฎ๐ถ๐น๐ฎ๐ฏ๐ถ๐น๐ถ๐๐ ๐ฎ๐ป๐ฑ ๐ณ๐ฎ๐๐น๐ ๐๐ผ๐น๐ฒ๐ฟ๐ฎ๐ป๐ฐ๐ฒ?
๐ ๏ธ ๐๐ฒ๐โ๐ ๐๐๐ฎ๐ฟ๐ ๐๐ถ๐๐ต ๐ฎ ๐ณ๐ฒ๐ ๐ฐ๐ผ๐บ๐บ๐ผ๐ป ๐ฎ๐ฝ๐ฝ๐ฟ๐ผ๐ฎ๐ฐ๐ต๐ฒ๐:
1๏ธโฃ ๐ง๐๐ผ ๐ฑ๐ฒ๐ฝ๐น๐ผ๐๐บ๐ฒ๐ป๐๐ ๐ถ๐ป ๐๐ต๐ฒ ๐๐ฎ๐บ๐ฒ ๐ฐ๐น๐๐๐๐ฒ๐ฟ
โข Each with its own Kubernetes Service
โข Your Ingress routes traffic to either blue or green depending on which one you want to serve customers.
2๏ธโฃ ๐๐น๐๐ฒ ๐ฎ๐ป๐ฑ ๐ด๐ฟ๐ฒ๐ฒ๐ป ๐๐ฒ๐ฝ๐ฎ๐ฟ๐ฎ๐๐ฒ๐ฑ ๐ฏ๐ ๐ป๐ฎ๐บ๐ฒ๐๐ฝ๐ฎ๐ฐ๐ฒ๐
โข Deploy both environments into different namespaces
โข Direct traffic to the target namespace using routing rules or service mesh(Istio).
3๏ธโฃ ๐ฆ๐ฒ๐ฝ๐ฎ๐ฟ๐ฎ๐๐ฒ ๐ฐ๐น๐๐๐๐ฒ๐ฟ๐ ๐ถ๐ป ๐๐ต๐ฒ ๐๐ฎ๐บ๐ฒ ๐ฟ๐ฒ๐ด๐ถ๐ผ๐ป
โข Blue and green run on completely different clusters for stronger isolation.
4๏ธโฃ ๐ฆ๐ฒ๐ฝ๐ฎ๐ฟ๐ฎ๐๐ฒ ๐ฐ๐น๐๐๐๐ฒ๐ฟ๐ ๐ถ๐ป ๐ฑ๐ถ๐ณ๐ณ๐ฒ๐ฟ๐ฒ๐ป๐ ๐ฟ๐ฒ๐ด๐ถ๐ผ๐ป๐ ๐
โข Adds disaster recovery capability on top of deployment isolation.
โ๏ธ ๐ช๐ต๐ถ๐ฐ๐ต ๐ผ๐ป๐ฒ ๐๐ต๐ผ๐๐น๐ฑ ๐๐ผ๐ ๐ฐ๐ต๐ผ๐ผ๐๐ฒ?
It depends on:
โข ๐ง๐ฟ๐ฎ๐ณ๐ณ๐ถ๐ฐ ๐๐ผ๐น๐๐บ๐ฒ ๐ฆ
โข ๐ฅ๐ฒ๐น๐ฒ๐ฎ๐๐ฒ ๐ณ๐ฟ๐ฒ๐พ๐๐ฒ๐ป๐ฐ๐ โฑ๏ธ
โข ๐๐๐ฑ๐ด๐ฒ๐ ๐ฐ
โข ๐ง๐ผ๐น๐ฒ๐ฟ๐ฎ๐ป๐ฐ๐ฒ ๐ณ๐ผ๐ฟ ๐ฑ๐ผ๐๐ป๐๐ถ๐บ๐ฒ ๐
โข ๐ก๐ฒ๐ฒ๐ฑ ๐ณ๐ผ๐ฟ ๐ฑ๐ถ๐๐ฎ๐๐๐ฒ๐ฟ ๐ฟ๐ฒ๐ฐ๐ผ๐๐ฒ๐ฟ๐ ๐
Iโm curious to know how youโre implementing Blue/Green deployments in your environment. Feel free to share
Top comments (0)