Commit 9882172
feat: Add complete GCP/GKE support to universal terraform stack (#60)
Implement full Google Cloud Platform support with GKE cluster
provisioning and managed services integration, following the existing
AWS/Azure patterns.
## Core Infrastructure
- **GKE Cluster** (deps/k8s_cluster/gcp.tf)
- Regional cluster with configurable Kubernetes version
- Dynamic node pools with autoscaling, taints, and labels
- Service accounts with proper IAM roles (logging, monitoring, GCR)
- Workload Identity support for pod-level IAM
- Private cluster configuration options
- Shielded nodes enabled by default
- Kubeconfig generation with gcloud authentication
## Managed Services
- **Cloud SQL PostgreSQL** (deps/postgres/gcp.tf)
- Managed PostgreSQL with HA options (REGIONAL/ZONAL)
- Automated backups and point-in-time recovery
- Private networking support
- Query insights and performance monitoring
- SSL/TLS configuration with ssl_mode
- **Memorystore Redis** (deps/redis/gcp.tf)
- Managed Redis with BASIC and STANDARD_HA tiers
- Auth enabled by default with transit encryption support
- Persistence configuration for HA tier
- Custom Redis configurations and maintenance windows
- **Cloud Storage** (deps/object_storage/gcp.tf)
- GCS buckets with automatic unique naming
- Service accounts with HMAC keys for S3-compatible access
- Versioning, lifecycle rules, and CORS support
- KMS encryption support
- Uniform bucket-level access
## Networking & DNS
- **VPC Network** (cloud/gcp/main.tf)
- Custom VPC with subnets and secondary IP ranges for GKE
- Cloud NAT for private node egress
- Firewall rules for internal communication
- Support for existing networks (BYO mode)
- **Cloud DNS** (deps/dns/gcp.tf)
- Managed zone integration
- Main and wildcard DNS records
- Configurable record types and TTLs
## Authentication & Secrets
- **Google OAuth** (deps/oauth/gcp.tf)
- Standard Google OAuth 2.0 integration
- Client credentials configuration
- OpenID Connect support
- **Secret Manager** (deps/secrets/gcp.tf)
- Documented Secret Manager API integration
- Works with Workload Identity
## Configuration
- Updated example config (examples/gcp-config.tfvars)
- Added project_id propagation to all GCP resources
- Made object storage credentials optional (auto-generated for GCP)
- Updated variable descriptions and validations
## Testing
- ✅ Terraform validation passes
- ✅ Terraform plan executes successfully (pending GCP auth)
- ✅ TFLint passes with only minor warnings
- ✅ Terraform fmt applied to all files
Total: +986 lines, -127 lines across 15 files
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds full GCP support to the Terraform stack: GKE, Cloud SQL,
Memorystore, GCS, VPC networking, and Cloud DNS. This brings GCP to
feature parity with AWS/Azure and enables end-to-end deployments on
Google Cloud.
- **New Features**
- VPC with subnets, secondary ranges for GKE, Cloud NAT, firewall rules,
and BYO network support.
- GKE regional cluster with autoscaled node pools, labels/taints,
Workload Identity, private cluster options, shielded nodes, and
kubeconfig via gcloud.
- Cloud SQL PostgreSQL with HA (REGIONAL/ZONAL), backups/PITR, private
networking, query insights, and SSL mode.
- Memorystore Redis (BASIC/STANDARD_HA) with auth, transit encryption,
persistence (HA), maintenance windows, and custom configs.
- GCS buckets with optional auto-naming, SA + HMAC keys for
S3-compatible access, versioning, lifecycle, CORS, KMS, and uniform
access.
- Cloud DNS managed zone integration with main record and optional
wildcard.
- Google OAuth 2.0 wiring and Secret Manager compatibility.
- Example tfvars updated; project_id propagated; object storage creds
optional on GCP.
- NGINX Ingress defaults to LoadBalancer; ACME defaults to production.
- Storage class now configurable with cloud defaults (AWS gp2, GCP
standard-rwo, Azure managed-premium).
- Docs & tooling: added GCP Testing Guide and test-gcp.sh; expanded GCP
README.
- Updated Loki Helm chart to 2.10.3.
- **Migration**
- Set project_id in each GCP block (GKE/Postgres/Redis/Object
storage/DNS).
- Ensure required APIs are enabled: Container, SQL Admin, Memorystore,
DNS, Storage.
- DNS: provide managed_zone and main_record_value (use LB/ingress IP).
- BYO network: disable VPC creation and pass existing network/subnet;
otherwise the module creates them.
- Object storage: you can omit access_key/secret_key; HMAC keys are
generated. bucket_name can be null to auto-generate.
- Kubeconfig uses gcloud; ensure gcloud is installed and authenticated.
- If testing certificates, set ACME to staging; default is production.
Ingress now uses a LoadBalancer—ensure quotas and capture the external
IP for DNS.
<sup>Written for commit b29cd6c.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>1 parent 3422f64 commit 9882172
File tree
25 files changed
+2014
-243
lines changed- btp
- cloud/gcp
- deps
- dns
- ingress_tls
- k8s_cluster
- oauth
- object_storage
- postgres
- redis
- secrets
- examples
25 files changed
+2014
-243
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments