DEV Community

Isreal Urephu
Isreal Urephu

Posted on

๐Ÿ’™๐Ÿ’š ๐—ช๐—ต๐—ฎ๐˜ ๐——๐—ผ๐—ฒ๐˜€ ๐—•๐—น๐˜‚๐—ฒ-๐—š๐—ฟ๐—ฒ๐—ฒ๐—ป ๐——๐—ฒ๐—ฝ๐—น๐—ผ๐˜†๐—บ๐—ฒ๐—ป๐˜ ๐—Ÿ๐—ผ๐—ผ๐—ธ ๐—Ÿ๐—ถ๐—ธ๐—ฒ ๐˜๐—ผ ๐—ฌ๐—ผ๐˜‚?

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)