Step 2: Create GCP prerequisites
The second step is to create the CDP prerequisites in your GCP project. To get this done quickly, we will use a script that creates a VPC network, a subnet, firewall rules, service accounts, storage buckets, and so on.
Navigate to the browser tab with the GCP console.
Click on the project navigation widget:
A window appears, allowing you to select a project. Copy the ID of the project where you created your credential earlier:You will need it in a later step
- In the GCP console, download the following files gcp-script.sh and gcp_param.yml:This is a script that creates all of the prerequisite resources required for CDP.
wget https://docs.cloudera.com/cdp/latest/quickstart-files/gcp-script.sh wget https://docs.cloudera.com/cdp/latest/quickstart-files/cloud/gcp_param.yml
- Run the provided bash script using the following command:
Replace the following with actual values:
bash gcp-script.sh <prefix> <region> <project-id> <IP-CIDR-to-whitelist>
Prefix- A prefix to prepend to names of all resources that the script creates for you.
Region- A GCP region where you would like to deploy your environment. For a list of supported regions, see Supported GCP regions.
Project ID- The project ID that you obtained in an earlier step. This is the project where you will deploy the resources required for a CDP environment.
CIDR-to-whitelist- The IPv4 CIDR range for SSH and UI access.
bash gcp-script.sh test us-east4 gcp-dev 22.214.171.124/24
- The script creates a new deployment called <prefix>-cdp-deployment in the Deployment Manager and creates resources in your GCP account:
The script does the following:
- Verify that the correct number of arguments were supplied.
- Replace the Deployment Manager config parameters with those arguments that you supplied.
- Check for the existence of a custom IAM role with the provided prefix (i.e. check if you have run this script before with the same prefix).
- Run the Deployment Manager (which creates resources such as a VPC network, a subnet, firewall rules, service accounts, storage buckets, and so on).
- Add policy bindings to the created service accounts
- Change GCS bucket permissions for created service accounts
- Create a VPC peering to servicenetworking.googleapis.com (for purposes of the CloudSQL DB that CDP creates).
Once the deployment is ready, you will see a message “<prefix>-cdp-deployment has been deployed”. At that point, you can proceed to the next step.