Cost Overview¶
Cost Monitoring¶
Orofi uses KubeCost (kubecost namespace) to track Kubernetes workload costs. KubeCost breaks down costs by namespace, deployment, and label, providing visibility into per-service infrastructure spend.
KubeCost UI: [NEEDS TEAM INPUT: KubeCost URL for each environment]
GCP Billing Dashboard: [NEEDS TEAM INPUT: GCP billing account link]
Resource Inventory by Environment¶
Development (orofi-dev-cloud)¶
| Resource | Type | Specification | Estimated Monthly Cost |
|---|---|---|---|
| GKE cluster nodes | e2-* (1–15 nodes) |
[NEEDS TEAM INPUT: machine type] | [NEEDS TEAM INPUT] |
| Cloud SQL | db-f1-micro, 20GB HDD |
MySQL 8.0, zonal | [NEEDS TEAM INPUT] |
| Redis | STANDARD_HA, 1GB |
Memorystore | [NEEDS TEAM INPUT] |
| Artifact Registry | Docker + Maven | us-central1 |
[NEEDS TEAM INPUT] |
| Cloud DNS | Managed zone | dev.orofi.xyz |
[NEEDS TEAM INPUT] |
| GCS (Terraform state) | oro-dev-infra |
Standard | [NEEDS TEAM INPUT] |
Staging (orofi-stage-cloud)¶
| Resource | Type | Specification | Estimated Monthly Cost |
|---|---|---|---|
| GKE cluster nodes | [NEEDS TEAM INPUT] | 1–15 nodes | [NEEDS TEAM INPUT] |
| Cloud SQL | db-n1-standard-1, 100GB SSD |
MySQL 8.0, REGIONAL HA | [NEEDS TEAM INPUT] |
| Redis | STANDARD_HA, 1GB, 1 replica |
Memorystore | [NEEDS TEAM INPUT] |
| Cloud DNS | Managed zone | stage.orofi.xyz |
[NEEDS TEAM INPUT] |
| GCS (Terraform state) | oro-infra-stag |
Standard | [NEEDS TEAM INPUT] |
Production¶
[NEEDS TEAM INPUT: document production resources and costs]
Cost Optimization — Current¶
Scale-Down Pipelines¶
Dev and staging clusters can be scaled to 0 nodes when not in use:
- Bitbucket pipelines: scale-down-dev and scale-down-staging
- Estimated savings: GKE node costs during off-hours ([NEEDS TEAM INPUT: quantify])
Dev vs Staging Tier Gap¶
Dev uses db-f1-micro (shared CPU, 20GB HDD) vs staging's db-n1-standard-1 (dedicated vCPU, 100GB SSD). The dev tier saves approximately [NEEDS TEAM INPUT] per month.
Dev: ZONAL vs REGIONAL SQL¶
Dev uses a ZONAL Cloud SQL instance (no standby replica), which costs approximately half of REGIONAL. For dev workloads, zonal is sufficient.
Cost Optimization Opportunities¶
Opportunity 1: Committed Use Discounts (CUDs)¶
If GKE node pool machine types are consistent, committing to 1-year or 3-year CUDs can save 30–55% on compute costs. - [NEEDS TEAM INPUT: evaluate CUD eligibility once production resource sizes are stable]
Opportunity 2: Spot Nodes for Dev/Staging¶
GKE supports Spot VMs (preemptible nodes) which can save up to 80% on compute. Suitable for dev and staging workloads that can tolerate interruption. - [NEEDS TEAM INPUT: evaluate Spot node pool for dev/staging]
Opportunity 3: Cloud SQL Dev Tier Right-Sizing¶
The db-f1-micro tier has limited CPU bursting. If dev migrations or load tests are slow due to DB CPU throttling, consider db-g1-small as a middle ground.
Opportunity 4: Automated Scale-Down Schedule¶
Instead of manual scale-down pipelines, configure automated scheduled scaling: - Scale down dev at 20:00 local time - Scale up dev at 08:00 local time - [NEEDS TEAM INPUT: implement via GKE Node Pool autoscaling scheduled actions or a Cloud Scheduler + Cloud Function]
Opportunity 5: Redis Tier Review¶
Both environments use STANDARD_HA Redis. If dev doesn't need HA, switching to BASIC tier would reduce cost.
- [NEEDS TEAM INPUT: evaluate dev Redis HA requirement]
Budget Alerts¶
[NEEDS TEAM INPUT: document GCP budget alerts configured on each project — threshold amounts and alert recipients.]