The brief
BloomingBet’s staging environment was first built by hand with gcloud. I moved it into Terraform and Kubernetes manifests, and planned what production would look like at a thousand registered users.
What I built
Staging on GKE Autopilot. The network, NAT, Cloud SQL instances, Artifact Registry, certificates, Workload Identity service accounts and Secret Manager containers are all in Terraform. Redis and Kafka are Kubernetes manifests, with a Redis per product.
Adopting what already existed. Because the environment predated the code, the first Terraform run imports every resource. The rule was zero creates, zero destroys and no replacements, and any resource that wanted replacing meant the config was wrong, not that I should apply it.
Secrets kept out of state. Terraform manages only the secret containers and the SQL users, with passwords ignored. Values go in with gcloud secrets versions add.
Deploys. Cloud Build deploys each image by commit SHA and moves the latest tag only after the rollout succeeds. Rollback is re-running the older build or pointing latest back.
The Cloud Run plan. A second Terraform stack describes phase one: ten services in four Cloud Run groups behind one global load balancer, Cloud SQL for MySQL and Postgres, Memorystore Redis, Cloud Storage, and Cloud NAT with two static IPs that payment providers can allow-list. Moving to ten thousand users means copying a tfvars file and changing sizes.
Where it stands
Staging is live. The Cloud Run stack is written but not applied yet.