This example shows how to do multi-region ingress using an L7 HTTP Load Balancer with regional clusters.
Figure 1. diagram of Google Cloud resources
[[ `basename $PWD` != example-gke-k8s-multi-region ]] && cd example-gke-k8s-multi-region
- Install Terraform if it is not already installed (visit terraform.io for other distributions):
../terraform-install.sh
- Set the project, replace
YOUR_PROJECT
with your project ID:
PROJECT=YOUR_PROJECT
gcloud config set project ${PROJECT}
- Configure the environment for Terraform:
[[ $CLOUD_SHELL ]] || gcloud auth application-default login
export GOOGLE_PROJECT=$(gcloud config get-value project)
terraform init
terraform apply
- Wait for the load balancer to be provisioned:
./test.sh
- Open the address of the load balancer:
echo http://$(terraform output load-balancer-ip)
- Delete resources created by terraform:
terraform destroy