Setting up a multi-cluster Ingress

Beta

This product or feature is in a pre-release state and might change or have limited support.
For more information, see the product launch
stages.

Overview

Caution: The kubemci tool is a temporary solution intended to help users begin
using multi-cluster Ingress. This tool will be replaced by an implementation
using kubectl that delivers a more Kubernetes-native experience. Once the
kubectl implementation is available, you will need to manually migrate any
apps that use kubemci.

If you have an application running on multiple Google Kubernetes Engine clusters
located in different regions, you can route
traffic to a cluster in the region closest to the user.

This page uses the kubemci
command-line tool to configure a Cloud HTTP Load Balancer
using a Kubernetes Ingress to route traffic across multiple clusters in
different regions.

Note: For each service that is part of the multi-cluster Ingress, you must
manually specify the nodePort in its manifest before creating it in each cluster.
If not explicitly specified, Kubernetes assigns a random nodePort by default,
which may result in the service having different nodePorts in different clusters.

You can iterate through all of the clusters and get the contexts to deploy the
application, along with its nodePort service, by running the following loop:

Note: If you modify your kubeconfig file, running this command with a
deployed multi-cluster Ingress only updates the Ingress objects in the
clusters specified in the current kubeconfig. Specifically, if contexts are
added, the Ingress is spread to the newly added clusters. If contexts
are removed, removed clusters will not see the updates.

delete, recreate

Alternatively, to update a multi-cluster Ingress, you can delete it and then create it again:

Note: You will incur downtime with this method because it takes time for
traffic to be forwarded to the newly created Ingress load balancers.

Removing clusters from an existing multi-cluster Ingress

To remove clusters from an existing multi-cluster Ingress, first create a
kubeconfig that contains a list of clusters that are to be removed from the
cluster, then run the kubemci remove-clusters command: