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. |
-
You have defined the variables in the Exporting common variables section.
-
Copy the template from the Infrastructure Manager template for the VPC section of this topic and save it as
01_vpc.tfin a directory called01_vpcon your computer. This template describes the VPC that your cluster requires. -
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. -
Configure environment variables that will be used to create other cluster infrastructure.
-
Configure the
CLUSTER_NETWORKenvironment variable by running the following command:$ export CLUSTER_NETWORK=$(gcloud compute networks describe ${INFRA_ID}-network --format json | jq -r .selfLink) -
Configure the
CONTROL_SUBNETenvironment 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) -
Configure the
COMPUTE_SUBNETenvironment 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)
-