Blue green deployment

712 views
Skip to first unread message

Youri Bonnaffé

unread,
Nov 17, 2015, 11:35:04 AM11/17/15
to gce-discussion
Hi,

We run services and would like to perform blue green deployment (http://martinfowler.com/bliki/BlueGreenDeployment.html). 
So far our setup is for each environment one compute instance with a network load balancer rule redirecting traffic to it.

My idea was to spawn a copy of the instance, add it the load balancer pool and remove the old one. While doing so I noticed a few seconds of downtime.
The way I did it was to edit the load balancer pool, add the new instance, remove the old one.

Would there be a better way to achieve such deployments? For instance would changing the pool (gcloud compute forwarding-rules set-target) of a forwarding rule be better to get a transparent switch to the new instance?
I also thought of switching the IP attached to the instance.

Regards,

 Youri

Kamran (Google Cloud Support)

unread,
Nov 17, 2015, 8:03:20 PM11/17/15
to gce-discussion

Hi Youri,

Please take a look at my answer in this thread which can be useful for your blue green deployment approach. 

Sincerely,

Kamran

Youri Bonnaffé

unread,
Nov 18, 2015, 3:35:35 AM11/18/15
to gce-discussion
Thanks for your answer.
Then to manually switch to the backup pool, would you use the approach described here : https://cloud.google.com/compute/docs/load-balancing/health-checks#handling_unhealthy_instances or can it be done via the web interface?

Youri Bonnaffé

unread,
Jan 17, 2016, 11:07:31 AM1/17/16
to gce-discussion
Hi,

Sorry for reviving this thread, but dealing with backup pools makes the blue green deployment process is bit complex.
I tried using a forwarding rule with a target instance (instead of target pool) as suggested by the documentation since we have only one instance as the target (https://cloud.google.com/compute/docs/load-balancing/network/target-pools). However when editing the rule to change the target instance, I observed a downtime, up to 2 minutes, when trying to hit the forwarding rule IP address.

By using target pool, it seems that there was no downtime but this required playing with backup pools and marking the instance as unhealthy with an iptable rule, making the whole thing complex.

Is there a better way to achieve this kind of deployments?

Thanks for your help,
Youri
Reply all
Reply to author
Forward
0 new messages