Configuring IaaS Routing for GCP

This topic describes how to configure the Google Cloud Platform (GCP) load balancers to handle routing for Cloud Foundry Container Runtime (CFCR).

Before completing the procedures in this topic, you must have performed the steps in Deploying BOSH for CFCR on GCP. After finishing this topic, continue to Deploying CFCR.

If you want to use Cloud Foundry for routing instead of IaaS load balancers, see the Configuring Cloud Foundry Routing topic.


CFCR was formerly known as Kubo, and many CFCR assets described in this topic still use the Kubo name.


Execute all of the commands in this topic from the Google Cloud Shell, not from your local machine.

(Optional) Step 1: Set Up Your Environment

If you are still working in the same Google Cloud Shell session from the Deploying BOSH for CFCR on GCP topic, skip to Step 2: Configure Load Balancers.

If you have started a new Google Cloud Shell session, perform the following steps:

  1. Set the prefix and zone from the Step 1: Set Up Your Shell Environment section of the Deploying BOSH for CFCR on GCP topic as environment variables. For example:

    $ export prefix=my-kubo $ export zone=us-west1-a $ export network=kubo-network $ export subnet_ip_prefix="10.0.1"

  2. SSH onto the bastion VM. Enter the following command:

    $ gcloud compute ssh "${prefix:-cfcr}-bosh-bastion" --zone ${zone}

  3. Set the kubo_env_name environment variable to kubo. Enter the following command:

    $ export kubo_env_name=kubo

Step 2: Configure Load Balancers

  1. Change into the GCP user guide directory of the kubo-deployment repo. Enter the following command:

    $ cd /share/kubo-deployment/docs/terraform/gcp/routing

  2. Export your state information as environment variables with the following commands:

    $ export state_dir=~/kubo-env/${kubo_env_name} $ export kubo_terraform_state=${state_dir}/terraform.tfstate

  3. Use Terraform to create the GCP resources for CFCR:

    $ terraform apply \ -var network=${network} \ -var projectid=${project_id} \ -var region=${region} \ -var prefix=${prefix:-cfcr} \ -var ip_cidr_range="${subnet_ip_prefix}.0/24" \ -state=${kubo_terraform_state}

  4. Set the master target pool from the outputted Terraform state file as an environment variable. Enter the following command:

    $ export master_target_pool=$(terraform output -state=${kubo_terraform_state} cfcr_master_target_pool)

  5. Set the Kubernetes master host from the outputted Terraform state file as an environment variable. Enter the following command:

    $ export kubernetes_master_host=$(terraform output -state=${kubo_terraform_state} master_lb_ip_address)

  6. Update the CFCR environment by running the set_iaas_routing script. Enter the following command:

    $ /usr/bin/set_iaas_routing "${state_dir}/director.yml"


    You can also set the configuration manually by editing KUBO_ENV/director.yml.

After configuring routing, continue to the Deploying CFCR topic.