How to create a GCP Kubernetes Engine cluster spanning two regions?

5/4/2018

I wish to know how to create a GCP Kubernetes Engine cluster spanning two regions. For instance, a cluster has some instances at "us-west1" region, and others at "us-central1" region.

My use case is to verify "failure-domain.beta.kubernetes.io/region" topology key is working as expected. I am aware of:
1. cluster federation: not supported yet for Kubernetes Engine
2. multi-cluster ingress: in development, but may not something I am looking for
3. regional cluster: not applicable as it focuses on replication in only one region

I am aware that my use case is not atypical.

-- jtee
google-cloud-platform
kubernetes

1 Answer

5/7/2018

It is possible, but I cannot say that will be a stable and fully functional configuration.

There are no standard tools to do what you want, but you can connect external nodes to your cluster from a different region manually. It will not work with kubeadm, but if you will setup kubelet manually - it will work, but with many limitations:

  1. No auto-updates.
  2. You should manage the connection between regions manually (you should have a private network with direct routing within all your nodes).
  3. You can have problems with logs, monitoring, load balancing, etc.
  4. You will pay for the traffic between internal and external nodes as for the external traffic.

Finally, although it is possible, I cannot recommend you to use it. If you really want to get a multi-region cluster - setup it yourself by kubeadm and use kubefed to create a federation.

-- Anton Kostenko
Source: StackOverflow