Hello, we have 2 clusters for our app, prod1 and prod2. At each release, we make the frontend point to the other cluster, and shut down the previous cluster.
How can I stop all machines in the previous cluster, preventing them from being automatically started by incoming requests, but still keeping the machines ready for the next release?
First, have you tried a
bluegreen deployment strategy instead? (flyctl deploy · Fly Docs)
If that’s not appropriate, one thing I would try is using the API to update each machine in a cluster to remove the service definition (and then bring the service definition back when needed on the next deploy): Working with the Machines API · Fly Docs
That all seems a bit complex tho - may I ask what the use case is for using 2 clusters?
Yes we tried the bluegreen strategy but it doesn’t offer enough control.
We do this to precisely control our blue green deployments:
- [frontend was pointing to prod1]
- deploy backend on prod2
- deploy frontend on staging, pointing to prod2
- check everything works with the new frontend & backend
- switch frontend from staging to production
- shutdown prod1
It’s not clear to me what “remove the service definition” means, could you provide an example please?
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.