Skip to main content

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.
This split ensures the main infrastructure Terraform never requires broad privileged credentials.

Prerequisites

  • Access to a GCP project with permissions to manage IAM, APIs, and compute resources
  • The following tools installed:
  • The following from Scale:
    • The SGP GCP Infrastructure modules (gcp/)
    • A workspace_id (8-digit number) and registration_secret unique to your deployment
  • 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 the projectsetup/ directory. This phase creates the Terraform service account and Artifact Registries. Edit the locals block at the top of projectsetup/main.tf:
Then initialize and apply:
This creates:
  • 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-secret in 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
The Terraform outputs include the 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:
Note: sgpctl manifest download requires internet access to https://control.egp.scale.com, so it must be run from a connected machine. Users with air-gapped operator workstations should run it from their laptop and SCP the output to wherever they’ll run the mirror commands. Authenticate to source + destination registries:
Mirror images and charts:
Verify the mirror:

Step 3: Configure the Deployment

Copy the deployments/prototype/ directory and rename it for your deployment:
Edit the 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.
If using SAML, place your IdP’s x509 certificate (without BEGIN/END lines) as x509.cer in the deployment directory. Update the samlConfigSecret in the module "sgp" block:
If using OIDC, update oidcConfigSecret instead:

Step 4: Provision Infrastructure via Terraform

From the deployment directory, initialize and apply:
This step can take 30–60 minutes due to GKE cluster provisioning and Cloud SQL setup. After apply completes, connect to the cluster:
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 set deploy_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:
Then run the bootstrap script:
This installs System Manager into the cluster. System Manager will then begin reconciling the desired_state.json file and deploying SGP services automatically.

Desired State

The desired_state.json file in your deployment directory defines which SGP packs System Manager installs. Update it to reference your GCP Artifact Registry:
See Step 6 for the SSL certificate options and how to set the correct value in the gcp block above.

Step 6: Configure SSL Certificates

Three options are available, in order of preference: Provisions a wildcard certificate (*.your-domain.com) via DNS authorization. Covers all subdomains automatically. Enable it in main.tf:
After terraform apply, note the two outputs:
  • certificate_manager_dns_auth_record — a CNAME you must add to your DNS zone for domain validation
  • certificate_map_name — typically sgp-<workspace_id>-cert-map
Add the CNAME to your DNS provider, then update desired_state.json:
The certificate typically provisions within 10–60 minutes of the DNS record being in place.

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 neither certificateMapName 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:
Reference it in desired_state.json:
Preshared certificates must be renewed manually. Let’s Encrypt certificates expire after 90 days.
After changing the SSL configuration in desired_state.json, restart System Manager to apply it:

Step 7: Configure DNS

Get the external IP address of the load balancer:
Create DNS A records in your DNS provider pointing to this IP for:
  • <deployment_url> (apex)
  • api.<deployment_url>
  • auth.<deployment_url>
  • app.<deployment_url>
If 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:
Then delegate the zone by configuring these as NS records at your domain registrar.

Step 8: Verify the Deployment

Wait for all services to be ready:
System Manager continuously reconciles the desired state. If a HelmRelease shows Ready=False, check its events:

Accessing the Platform

Once all HelmReleases are ready and DNS resolves correctly, navigate to https://<workspace_id>.workspace.egp.scale.com (or your custom domain) and authenticate via your configured identity provider.