feat(gcp): add native managed data bootstrap

Merged
KH
12d ago
+989-27

Summary

  • make the GCP existing-cluster example provision the native Sessions data path: TLS-only Standard HA Memorystore, Pub/Sub pull queue and DLQ, exact Workload Identity IAM, and the relaycontrol/relaycast/hoopdb database set
  • add shared-CA Cloud SQL DNS with a private DNS mapping so every PostgreSQL URL uses sslmode=verify-full
  • add an idempotent cloud-sql-setup.sh pre|post for databases, owners, runtime roles, extensions, CA delivery, credential files and post-migration login activation

Validation

  • terraform -chdir=terraform/examples/gcp validate
  • example mock apply: 1 passed
  • postgres module tests: 8 passed
  • TFLint and terraform-docs checks for both changed roots
  • bash -n and ShellCheck for the setup script
  • scripts/selfhost/tests/run-tests.sh (all passed)

Live GKE apply/e2e is tracked separately and awaits refreshed noninteractive gcloud credentials.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Adds the native Sessions data path to the GCP example: TLS-only HA Memorystore, a Pub/Sub pull queue with DLQ, and exact Workload Identity IAM. chart_values is now a complete overlay for values-gcp-native.yaml, also covering the read API, ingest edge, and search indexer; Cloud SQL uses a shared CA with private DNS, and the postgres module preserves the verified FQDN byte-for-byte (terminal dot included) so application URLs use sslmode=verify-full.

  • The cloud-sql-setup.sh pre|post provisions databases, roles, extensions, and credentials idempotently, bootstrapping the session consumer role before the migration Job runs; SQL runs in short-lived hardened Jobs inside GKE. The post step resolves the current HoopDb migrate Job from the Helm manifest and activates logins only once that exact Job has completed and none has failed.
  • Adds the relaycast database while retaining relayhistory so legacy installs are never destructively updated; relaycast stays owned by the Cloud SQL admin to satisfy the production owner-boundary check, and Workload Identity principals match the native pipeline service accounts.
  • Defaults deletion_protection to true for Cloud SQL, Memorystore, and Pub/Sub; set false for disposable proof environments.
  • Adds offline test suites for the setup script and native Terraform assertions.