Blue/green deployment with Cloudflare Load Balancer

We’re investigating using Cloudflare Load Balancer as our primary load balancer, but we can’t find any good info in how to do proper zero-downtime deploys.

The approach I’m thinking about for this is:

  1. Deploy new instances, run warmup on them. All of this while the old/current instances are still recieving traffic.
  2. Send one HTTP request to the Cloudflare API to add the new instances to the pool and at the same time mark the old instances as disabled.
  3. A while later (when all traffic to the old instances should have finished) remove the old instances from the pool.

What I hope that this achieves is a blue/green deployment, but there’s a bit of crucial question for me here. Is that single request to the API somewhat atomic? What I hope to achieve is that all traffic to the old instances are allowed to finnish while at the same time being sure that all new traffic is routed to the new instances. What I really don’t want is for visitors to be routed to both old and new instances even for a very short period of time.

1 Like

Can you share how you finally accomplished this blue/green deployment?

1 Like