How to blue/green deploy?
mneira10
PROOP

2 years ago

We're thinking of migrating our k8s stack over to railway. An important requirement for us is to be able to do blue/green deploys so that breaking changes between our backend and frontend servers can be done without thinking about intermediate steps. I haven't seen any docs on this. Can this be done in railway?

6 Replies

brody
EMPLOYEE

2 years ago

Railway does blue/green deployments by default, but only on per service level meaning there's currently no mechanism to have two services go out together or fail together, on account of services having no real link between each other.


mneira10
PROOP

2 years ago

there's currently no mechanism to have two services go out together or fail together, on account of services having no real link between each other.

Gotcha!

As a workaround, if we setup nginx to route traffic between the backend and frontend services could we then:

  1. Create a new pair of services every time we want to deploy a new version of our app

  2. Wait for the new services to be up with the health-check config

  3. Point nginx at the new services

  4. Delete old services

?

Not as pretty as having only 2 services go out together or fail together but that would let us consider moving to railway


mneira10
PROOP

2 years ago

Another idea: you could have the healthcheck endpoints of each of the services reach out to the other services to return a 200. That way you effectively couple all services together.


brody
EMPLOYEE

2 years ago

Seems a bit complex with room for issues, you could run the frontend and backend in the same container that way they already go out together.


mneira10
PROOP

2 years ago

you could run the frontend and backend in the same container that way they already go out together.

Hmm that would mean that they both have to scale equally. In our infra, the backend is a LOT more resource heavy than the frontend.


brody
EMPLOYEE

2 years ago

Yep it's not a perfect solution either, please express your need for this here -

https://help.railway.app/feedback/service-dependencies-rollouts-6b418f05


Loading...