DEV Community

loading...

Discussion on: Intro to deployment strategies: blue-green, canary, and more

Collapse
volkanumg profile image
Volkan Paksoy

Hi Jason,
Thanks for the article. I have an issue with Blue-Green deployment which I'm trying to implement. The application I'm working on has several components such as an Angular SPA front-end, public-facing APIs and database.

I am fine with pointing both blue and green to the same production database. My problem is with the APIs. When I deploy to staging.mydomain.com my staging frontend is also pointing to production instead of staging APIs. If I deploy with staging configuration values, I don't currently have a way of changing those values without re-deploying.

So basically I can manage switching 1 ELB but I'm struggling when different components behind different ELBs need to speak with each other.

What would you recommend to address such a scenario?

Thanks again for the insightful article.

Kind regards,
Volkan

Collapse
mostlyjason profile image
Jason Skowronski Author

Hey Volkan, first of all staging environments are a bit of a different concept since blue-green deployments are typically to production environments. Typically staging environments are considered temporary and you have a separate deployment to production.

To address your question through, I'll have to guess what you mean by "staging configuration values". One simple solution is to add some environment variables (or other configuration) for staging environments that tell the app where to find the appropriate services. For example, you might include the host name for your API as an environment variable, then you'd have one value for staging and a different one for production. Alternatively, if your staging app is in its own VPC or internal network, you can use the same host name to connect to your API in both environments, but just have separate instances for each environment. More sophisticated environments might use service discovery or a service mesh to dynamically route to the right API.

Hope that helps!

Collapse
volkanumg profile image
Volkan Paksoy

Hi Jason,

Thanks for your response.

I guess I used the terminology incorrectly. By staging I essentially mean the green production environment.

That's indeed helpful.

Kind regards,
Volkan

Forem Open with the Forem app