Configuring blue/green gke cluster switch with no downtime

7/19/2019

When we change from blue to green gke cluster, what is the best way to make sure incomming traffic instantly goes to the new cluster, with no client interruption?

We currently use CloudFlare api to keep the dns updated, but we would prefer not to wait for dns propagation.

We've considered the following:

  1. Reserved IP - Would result in a short downtime when reassigning the IP.
  2. Loadbalancer - Possible.
  3. Using another cluster as the Loadbalancer - Possible, but what about B/G switching on that cluster?

Edit: The reason we want this, is to be more flexible. We can currently create the new cluster, setup everything even with major changes, test it, and finally switch traffic over to the new cluster. The way we do now is using DNS, and setting the old cluster to forward to the new, but I want more control over this switch. We are doing blue/green inside the cluster also.

-- JanRK
google-cloud-platform
google-kubernetes-engine
network-programming

2 Answers

7/26/2019

You can acheive blue/green deployments in GKE using istio with flagger, Flagger is well known for canary and blue/green deployments. You dont need to change DNS between different clusters to achieve blue/green.

What you do is create deployment files (yaml) for kubernetes and define create new file with kind:Canary. K8 will deploy your app after automated load testing and conformance testing.(You can look into this document for furthur info : https://docs.flagger.app/usage/blue-green)

-- Rezwan
Source: StackOverflow

7/23/2019

Why are you switching between clusters? you can achieve either blue/green or canary deployment within the same cluster with minimal effort and minimal additional resources.

The second you redirect traffic from 1 cluster to another, there will be a delay. Now if you keep both clusters running, there will be no downtime, but there will be a delay in switching over, it won't be instantaneous. You can have the green cluster running and receiving traffic and deploy your blue cluster; once the blue cluster is up, update your DNS to point to the new external IP of your service. The propagation may take a bit of time, but there won't be any downtime.

-- Patrick W
Source: StackOverflow