|
| 1 | +# Deploying Cube Cloud BYOC on GCP |
| 2 | + |
| 3 | +With Bring Your Own Cloud (BYOC) on Google Cloud Platform (GCP), all the components interacting with private data are deployed on |
| 4 | +the customer infrastructure on GCP and managed by the Cube Cloud Control Plane via the Cube Cloud Operator. |
| 5 | +This document provides step-by-step instructions for deploying Cube Cloud BYOC on GCP. |
| 6 | + |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +The bulk of provisioning work will be done remotely by Cube Cloud automation. |
| 10 | +However, to get started, you'll need to provide Cube with the necessary access |
| 11 | +along with some additional information that includes: |
| 12 | + |
| 13 | +- **GCP Project ID:** A dedicated GCP project ID that will exclusively host Cube-managed infrastructure. |
| 14 | + This should be a new, isolated project created specifically for Cube Cloud BYOC. |
| 15 | +- **GCP Region:** [The GCP region][gcp-docs-regions] where Cube Cloud resources |
| 16 | + should be deployed. |
| 17 | + |
| 18 | +In addition to that, you'll need to make sure you have sufficient access to grant |
| 19 | +IAM permissions in the dedicated project to allow Cube Cloud to: |
| 20 | +- Create and manage VPC networking |
| 21 | +- Create and manage GKE clusters |
| 22 | +- Create and manage Cloud Storage buckets |
| 23 | +- Create and manage Cloud DNS zones |
| 24 | +- Create and manage service accounts |
| 25 | +- Configure IAM permissions for resources |
| 26 | +- Read from Artifact Registry |
| 27 | + |
| 28 | +## Provisioning access |
| 29 | + |
| 30 | +### Create a dedicated GCP project |
| 31 | + |
| 32 | +We strongly recommend creating a dedicated GCP project that will exclusively host |
| 33 | +Cube-managed infrastructure. This project isolation approach simplifies permission |
| 34 | +management and provides clear resource boundaries. |
| 35 | + |
| 36 | +Navigate to the [GCP Console][gcp-console] and create a new project for Cube Cloud BYOC. |
| 37 | +Note the **Project ID** (not the project name) as you'll need it for the next steps |
| 38 | +and to share with your Cube contact point. |
| 39 | + |
| 40 | +### Grant IAM permissions |
| 41 | + |
| 42 | +In order to manage resources in the Cube-dedicated GCP project, Cube Cloud Service Principal |
| 43 | +needs to be granted administrative permissions to a set of services. |
| 44 | + |
| 45 | +Navigate to **IAM & Admin > IAM** in your dedicated project and add the following IAM |
| 46 | +binding for the Cube Cloud service account: |
| 47 | + |
| 48 | +**Principal:** `cube-cloud-byoc-installer@cube-cloud-byoc.iam.gserviceaccount.com` |
| 49 | + |
| 50 | +**Roles:** |
| 51 | + |
| 52 | +- **Compute Admin** (`roles/compute.admin`) - Allows creation and management of VPC networks, subnets, routers, NAT gateways, firewall rules, IP addresses, and Private Service Connect endpoints |
| 53 | +- **Kubernetes Engine Admin** (`roles/container.admin`) - Allows creation and management of GKE clusters and node pools |
| 54 | +- **Storage Admin** (`roles/storage.admin`) - Allows creation and management of Cloud Storage buckets for Cube Store |
| 55 | +- **Service Account Admin** (`roles/iam.serviceAccountAdmin`) - Allows creation and management of service accounts for cluster nodes and workload identity |
| 56 | +- **Project IAM Admin** (`roles/resourcemanager.projectIamAdmin`) - Allows granting IAM permissions to created resources (e.g., bucket access for service accounts) |
| 57 | + |
| 58 | +You can grant these permissions through the Google Cloud Console UI or using the |
| 59 | +`gcloud` command-line tool: |
| 60 | + |
| 61 | +```bash |
| 62 | +# Set your project ID |
| 63 | +export PROJECT_ID="your-cube-byoc-project-id" |
| 64 | + |
| 65 | +# Set the Cube Cloud service account |
| 66 | +export CUBE_SA="cube-cloud-byoc-installer@cube-cloud-byoc.iam.gserviceaccount.com" |
| 67 | + |
| 68 | +# Grant all required roles |
| 69 | +gcloud projects add-iam-policy-binding $PROJECT_ID \ |
| 70 | + --member="serviceAccount:$CUBE_SA" \ |
| 71 | + --role="roles/compute.admin" |
| 72 | + |
| 73 | +gcloud projects add-iam-policy-binding $PROJECT_ID \ |
| 74 | + --member="serviceAccount:$CUBE_SA" \ |
| 75 | + --role="roles/container.admin" |
| 76 | + |
| 77 | +gcloud projects add-iam-policy-binding $PROJECT_ID \ |
| 78 | + --member="serviceAccount:$CUBE_SA" \ |
| 79 | + --role="roles/storage.admin" |
| 80 | + |
| 81 | +gcloud projects add-iam-policy-binding $PROJECT_ID \ |
| 82 | + --member="serviceAccount:$CUBE_SA" \ |
| 83 | + --role="roles/iam.serviceAccountAdmin" |
| 84 | + |
| 85 | +gcloud projects add-iam-policy-binding $PROJECT_ID \ |
| 86 | + --member="serviceAccount:$CUBE_SA" \ |
| 87 | + --role="roles/resourcemanager.projectIamAdmin" |
| 88 | +``` |
| 89 | + |
| 90 | +### Enable required APIs |
| 91 | + |
| 92 | +Ensure the following GCP APIs are enabled in your dedicated project: |
| 93 | + |
| 94 | +- Compute Engine API (`compute.googleapis.com`) |
| 95 | +- Kubernetes Engine API (`container.googleapis.com`) |
| 96 | +- Cloud Storage API (`storage.googleapis.com`) |
| 97 | +- IAM API (`iam.googleapis.com`) |
| 98 | +- Service Networking API (`servicenetworking.googleapis.com`) |
| 99 | + |
| 100 | +You can enable these APIs through the [API Library][gcp-api-library] in the GCP Console, |
| 101 | +or use the `gcloud` command: |
| 102 | + |
| 103 | +```bash |
| 104 | +gcloud services enable compute.googleapis.com \ |
| 105 | + container.googleapis.com \ |
| 106 | + storage.googleapis.com \ |
| 107 | + iam.googleapis.com \ |
| 108 | + servicenetworking.googleapis.com \ |
| 109 | + --project=$PROJECT_ID |
| 110 | +``` |
| 111 | + |
| 112 | +## Deployment |
| 113 | + |
| 114 | +The actual deployment will be done by Cube Cloud automation. All that's left to |
| 115 | +do is notify your Cube contact point that access has been granted, and pass |
| 116 | +along your GCP Project ID and Region information. |
| 117 | + |
| 118 | +After deployment, Cube Cloud will manage the following resources in your dedicated project: |
| 119 | + |
| 120 | +- A VPC network with subnets, Cloud Router, and Cloud NAT for outbound connectivity |
| 121 | +- A GKE cluster with node pools for running Cube applications |
| 122 | +- Cloud Storage buckets for Cube Store data |
| 123 | +- Service accounts and IAM bindings for secure resource access |
| 124 | +- Firewall rules and network policies for security |
| 125 | + |
| 126 | +[gcp-console]: https://console.cloud.google.com/ |
| 127 | +[gcp-docs-regions]: https://cloud.google.com/compute/docs/regions-zones |
| 128 | +[gcp-api-library]: https://console.cloud.google.com/apis/library |
0 commit comments