Overview
This guide covers deploying SGP in a GCP project using the SGP GCP Terraform modules. SGP GCP infrastructure is defined by terraform modules managed by Scale.SGP is deployed jointly with Scale engineering. Scale provides everything under “The following from Scale” in Prerequisites and stays involved for upgrades and ongoing operation. Contact your Scale team before you start.
projectsetup/— Run once with privileged GCP credentials. Creates a dedicated Terraform service account with broad project administration roles, 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.
roles/compute.admin, roles/container.admin, roles/cloudsql.admin, roles/secretmanager.admin, roles/resourcemanager.projectIamAdmin, roles/iam.serviceAccountKeyAdmin, roles/artifactregistry.admin, and roles/storage.admin. Review the complete role list in the provided projectsetup/main.tf before granting access.
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) 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-secret-2in 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 project bootstrap stores the key in terraform-service-account-key-secret-2. Before initializing your copied deployment, set the service-account-private-key data source to read that secret:
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. After you set the secret name in Step 1, the deployment reads its Terraform service account credentials from Secret Manager; no key file is required on disk.
aes256EncryptionKey on a running deployment: data encrypted with the old key becomes unreadable.
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:
oidcConfigSecret instead:
Desired State
Thedesired_state.json file in your deployment directory defines which SGP packs System Manager installs. terraform apply copies it into the System Manager configuration, and System Manager reads it only on first install, while its desired state is empty. Finish it, including the certificate setting from Step 4, before you run Terraform in Step 5. After the first install, editing the local file has no effect; update the live desired state in the System Manager GUI, API, or Secret Manager instead, then install the affected packs. Update the file to reference your GCP Artifact Registry:
gcp block above uses a preshared certificate. Step 4 covers that option and the other two.
Step 4: Configure SSL Certificates
The options are listed in order of preference. Choose one before you run Terraform in Step 5:
For each option, edit the existing
sgp-base entry and preserve its other properties. When you switch certificate options, replace the existing presharedCertificates list instead of adding to it. Before switching to a managed certificate, make sure every presharedCertificates list in your configuration is empty.
Option 1: Google Certificate Manager (Recommended)
Set both flags inmain.tf, and add an output for the DNS authorization record, which the prototype doesn’t export. Terraform passes the certificate map to the sgp-base pack:
terraform apply in Step 5, run terraform output certificate_manager_dns_auth_record and add that CNAME to your DNS zone for domain validation. The certificate typically provisions within 10–60 minutes of the DNS record being in place.
Terraform passes the Gateway API setting and certificate-map name to the sgp-base pack as defaults, and desired-state value_overrides take precedence over them. If you set overrides explicitly, merge the following gcp values into the existing sgp-base entry, preserving its other properties, and install that pack. A certificate map requires the Gateway template:
Option 2: Google Managed Certificate
Google provisions the certificates after DNS resolves to the load balancer IP in Step 7. This is the traditional GCE Ingress default whengcp.gatewayApi.enabled is false and presharedCertificates is empty. To switch from another certificate option, merge these values into the existing sgp-base entry and install the pack:
properties.helm-base.value_overrides, preserving the entry’s other properties. These values override the Gateway settings that Terraform provides. Make sure every presharedCertificates list in your configuration is empty. Omitting a key does not clear a Terraform-provided default.
Option 3: Preshared Certificate
Upload the certificate:sgp-base entry, keeping its other properties. Before the first install, edit desired_state.json; after it, edit the live desired state. These values disable Gateway API and select the preshared certificate:
desired_state.json after the first install have no effect. To change the SSL configuration then:
- Edit the
sgp-basepack’s value overrides in the System Manager GUI or API. An API update replaces the pack’s wholehelm-baseobject, so send all of its value overrides, includingrefreshRegcred. - To move to Option 1, also set its two flags in
main.tfand runterraform apply.
sgp-base in the System Manager GUI to apply the change. With the default startup configuration, restarting System Manager also applies the live state by reinstalling all packs:
Step 5: 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 bastion host (via IAP, as one of the bastion_iap_members from Step 3) or a network-connected runner to access it.Step 6: Bootstrap the Cluster
SGP System Manager orchestrates SGP service deployment. If you setdeploy_system_manager = false in Step 3, bootstrap it manually using the provided script.
Edit manual-helm-install.sh in your deployment directory with the correct values:
desired_state.json. Startup installation is enabled by default, so each startup installs all packs in the live desired state. If startup installation is disabled, install the packs in the System Manager GUI. See System Manager configuration for the chart-version requirement.
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.