Skip to content

Latest commit

 

History

History
95 lines (79 loc) · 3.44 KB

installation-creating-gcp-dns.adoc

File metadata and controls

95 lines (79 loc) · 3.44 KB

Creating networking and load balancing components in GCP

You must configure networking and load balancing in Google Cloud Platform (GCP) for your {product-title} cluster to use. One way to create these components is to modify the provided Deployment Manager template.

Note

If you do not use the provided Deployment Manager template to create your GCP 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
  • Configure a GCP account.

  • Generate the Ignition config files for your cluster.

  • Create and configure a VPC and associated subnets in GCP.

Procedure
  1. Copy the template from the Deployment Manager template for the network and load balancers section of this topic and save it as 02_infra.py on your computer. This template describes the networking and load balancing objects that your cluster requires.

  2. Export the following variable required by the resource definition:

    $ export CLUSTER_NETWORK=`gcloud compute networks describe ${INFRA_ID}-network --format json | jq -r .selfLink`
  3. Create a 02_infra.yaml resource definition file:

    $ cat <<EOF >02_infra.yaml
    imports:
    - path: 02_infra.py
    
    resources:
    - name: cluster-infra
      type: 02_infra.py
      properties:
        infra_id: '${INFRA_ID}' (1)
        region: '${REGION}' (2)
    
        cluster_domain: '${CLUSTER_NAME}.${BASE_DOMAIN}' (3)
        cluster_network: '${CLUSTER_NETWORK}' (4)
    EOF
    1. infra_id is the INFRA_ID infrastructure name from the extraction step.

    2. region is the region to deploy the cluster into, for example us-east1.

    3. cluster_domain is the domain for the cluster, for example openshift.example.com.

    4. cluster_network is the selfLink URL to the cluster network.

  4. Create the deployment by using the gcloud CLI:

    $ gcloud deployment-manager deployments create ${INFRA_ID}-infra --config 02_infra.yaml
  5. The templates do not create DNS entries due to limitations of Deployment Manager, so you must create them manually:

    1. Export the following variable:

      $ export CLUSTER_IP=`gcloud compute addresses describe ${INFRA_ID}-cluster-public-ip --region=${REGION} --format json | jq -r .address`
    2. Add external DNS entries:

      $ if [ -f transaction.yaml ]; then rm transaction.yaml; fi
      $ gcloud dns record-sets transaction start --zone ${BASE_DOMAIN_ZONE_NAME}
      $ gcloud dns record-sets transaction add ${CLUSTER_IP} --name api.${CLUSTER_NAME}.${BASE_DOMAIN}. --ttl 60 --type A --zone ${BASE_DOMAIN_ZONE_NAME}
      $ gcloud dns record-sets transaction execute --zone ${BASE_DOMAIN_ZONE_NAME}
    3. Add internal DNS entries:

      $ if [ -f transaction.yaml ]; then rm transaction.yaml; fi
      $ gcloud dns record-sets transaction start --zone ${INFRA_ID}-private-zone
      $ gcloud dns record-sets transaction add ${CLUSTER_IP} --name api.${CLUSTER_NAME}.${BASE_DOMAIN}. --ttl 60 --type A --zone ${INFRA_ID}-private-zone
      $ gcloud dns record-sets transaction add ${CLUSTER_IP} --name api-int.${CLUSTER_NAME}.${BASE_DOMAIN}. --ttl 60 --type A --zone ${INFRA_ID}-private-zone
      $ gcloud dns record-sets transaction execute --zone ${INFRA_ID}-private-zone