Skip to content

Latest commit

 

History

History
60 lines (48 loc) · 2.46 KB

File metadata and controls

60 lines (48 loc) · 2.46 KB

Creating a VPC in {gcp-short}

You must create a VPC in {gcp-first} for your {product-title} cluster to use. You can customize the VPC to meet your requirements. One way to create the VPC is to modify the provided Infrastructure Manager template.

Note

If you do not use the provided Infrastructure Manager template to create your {gcp-short} infrastructure, you must review the provided information and manually create the infrastructure. If your cluster does not initialize correctly, you might have to contact Red Hat support with your installation logs.

Prerequisites
  • You have defined the variables in the Exporting common variables section.

Procedure
  1. Copy the template from the Infrastructure Manager template for the VPC section of this topic and save it as 01_vpc.tf in a directory called 01_vpc on your computer. This template describes the VPC that your cluster requires.

  2. Create a VPC by running the following command:

    $ gcloud infra-manager deployments apply <vpc_name> \
      --location=${REGION} \
      --input-values=infra_id=${INFRA_ID},project=${PROJECT_NAME},region=${REGION},master_subnet_cidr=${MASTER_SUBNET_CIDR},worker_subnet_cidr=${WORKER_SUBNET_CIDR} \
      --project=${PROJECT_NAME} \
      --local-source=./01_vpc \
      --service-account=${INSTALL_SERVICE_ACCOUNT}

    <vpc_name> specifies the name of the VPC you create.

  3. Configure environment variables that will be used to create other cluster infrastructure.

    1. Configure the CLUSTER_NETWORK environment variable by running the following command:

      $ export CLUSTER_NETWORK=$(gcloud compute networks describe ${INFRA_ID}-network --format json | jq -r .selfLink)
    2. Configure the CONTROL_SUBNET environment variable by running the following command:

      $ export CONTROL_SUBNET=$(gcloud compute networks subnets describe ${INFRA_ID}-master-subnet --region=${REGION} --format json | jq -r .selfLink)
    3. Configure the COMPUTE_SUBNET environment variable by running the following command:

      $ export COMPUTE_SUBNET=$(gcloud compute networks subnets describe ${INFRA_ID}-worker-subnet --region=${REGION} --format json | jq -r .selfLink)