Overview
This guide walks you through deploying SGP in a GCP project using the SGP GCP Terraform modules. SGP GCP infrastructure is defined by terraform modules managed by Scale. GCP deployment is split into two Terraform phases with different privilege levels:projectsetup/— Run once with privileged GCP credentials. Creates a dedicated Terraform service account (with least privileges), enables required GCP APIs, and provisions Artifact Registries for SGP images and Helm charts.deployments/<your-deployment>/— Run with the service account created above. Provisions the GKE cluster, Cloud SQL, networking, and all SGP infrastructure.
Prerequisites
- Access to a GCP project with permissions to manage IAM, APIs, and compute resources
- The following tools installed:
- gcloud CLI (
gcloud auth logincompleted) - Terraform (
>= 1.1.7) - kubectl
- helm (for cluster bootstrap)
- crane or Docker (for copying images)
- [sgpctl] (https://github.com/scaleapi/sgpctl) (cli tool to execute system manager related commands)
- gcloud CLI (
- The following from Scale:
- The SGP GCP Infrastructure modules (
gcp/) - A
workspace_id(8-digit number) andregistration_secretunique to your deployment
- The SGP GCP Infrastructure modules (
- A new application configured in your identity provider to authenticate to the SGP platform (SAML or OIDC) (optional)
- A custom domain for your deployment (optional)
Installation
Step 1: Bootstrap the Project
Navigate to theprojectsetup/ directory. This phase creates the Terraform service account and Artifact Registries.
Edit the locals block at the top of projectsetup/main.tf:
- A Terraform service account (
sgp-tf-lp-<service_account_name>) with the IAM roles needed to provision SGP infrastructure - A service account key stored as
terraform-service-account-key-secretin Secret Manager - Docker and Helm Artifact Registries (
sgp-<workspace_id>-docker-repository,sgp-<workspace_id>-helm-repository) - All required GCP APIs enabled on the project
service_account_email of the newly created service account, which is useful for auditing. The service account key is automatically stored in Secret Manager and read by the main infrastructure Terraform — no manual key management is required.
Step 2: Copy SGP Images and Helm Charts
This step is only required if your deployment is configured to block internet access from the cluster (offline_mode in step 3).
Before provisioning the main infrastructure, copy SGP’s Docker images and Helm charts from Scale’s registry into your GCP Artifact Registry.
Download the manifest from Scale’s control plane:
Step 3: Configure the Deployment
Copy thedeployments/prototype/ directory and rename it for your deployment:
locals block at the top of main.tf. The deployment reads its Terraform service account credentials automatically from Secret Manager — no key file is required on disk.
x509.cer in the deployment directory. Update the samlConfigSecret in the module "sgp" block:
oidcConfigSecret instead:
Step 4: Provision Infrastructure via Terraform
From the deployment directory, initialize and apply:If
gke_config.private_endpoint = true, the cluster API server is only accessible from within the VPC. Use the provisioned bastion host (via IAP) or a network-connected runner to access it. Set bastion_enabled = true and add your user email to bastion_iap_members in the security_compliance block to enable bastion access.Step 5: Bootstrap the Cluster
SGP System Manager orchestrates SGP service deployment. If you setdeploy_system_manager = false in the previous step, bootstrap it manually using the provided script.
Edit manual-helm-install.sh in your deployment directory with the correct values:
desired_state.json file and deploying SGP services automatically.
Desired State
Thedesired_state.json file in your deployment directory defines which SGP packs System Manager installs. Update it to reference your GCP Artifact Registry:
gcp block above.
Step 6: Configure SSL Certificates
Three options are available, in order of preference:Option 1: Google Certificate Manager (Recommended)
Provisions a wildcard certificate (*.your-domain.com) via DNS authorization. Covers all subdomains automatically.
Enable it in main.tf:
terraform apply, note the two outputs:
certificate_manager_dns_auth_record— a CNAME you must add to your DNS zone for domain validationcertificate_map_name— typicallysgp-<workspace_id>-cert-map
desired_state.json:
Option 2: Google Managed Certificate
Google provisions and auto-renews per-subdomain certificates. Does not require uploading a certificate, but requires DNS to resolve to the load balancer IP before provisioning, and does not support wildcards. This is the default when neithercertificateMapName nor presharedCertificates is set in the sgp-base pack’s gcp block. Simply omit those keys from desired_state.json.
Option 3: Preshared Certificate
Use a certificate you manage and upload to Google Cloud. Required when DNS is not publicly resolvable or Certificate Manager is not available. Upload the certificate:desired_state.json:
desired_state.json, restart System Manager to apply it:
Step 7: Configure DNS
Get the external IP address of the load balancer:<deployment_url>(apex)api.<deployment_url>auth.<deployment_url>app.<deployment_url>
createDNSRecords = true in your main.tf locals, Terraform manages a Cloud DNS zone and creates these records automatically. Retrieve the name servers from the Terraform output:
Step 8: Verify the Deployment
Wait for all services to be ready:Ready=False, check its events:
Accessing the Platform
Once all HelmReleases are ready and DNS resolves correctly, navigate tohttps://<workspace_id>.workspace.egp.scale.com (or your custom domain) and authenticate via your configured identity provider.
