Overview
Optimize infrastructure costs while maintaining performance, security, and reliability. This guide provides actionable strategies achieving 30-66% cost reduction.GKE Autopilot
40-60% savings vs. Standard GKE
Committed Use
25-52% additional discounts
Right-sizing
10-30% from resource optimization
GCP Cost Optimization
Current vs. Optimized
- Production
- All Environments
| Approach | Monthly Cost | Annual Cost | Savings |
|---|---|---|---|
| Baseline GKE | $1,290 | $15,480 | - |
| Autopilot | $970 | $11,640 | 25% |
| + 1yr CUD | $728 | $8,736 | 43% |
| + 3yr CUD | $466 | $5,592 | 66% |
Strategy 1: GKE Autopilot
Pay-per-pod pricing eliminates idle node costs:How Autopilot Saves Money
How Autopilot Saves Money
Traditional GKE Standard:
- Pay for entire nodes (even when idle)
- Typical utilization: 50-70%
- Waste: 30-50% of spend
- Pay only for pod resources used
- No idle costs
- Automatic bin-packing
Strategy 2: Committed Use Discounts (CUDs)
Commit to 1-year or 3-year usage for significant discounts:| Resource | 1-Year | 3-Year |
|---|---|---|
| GKE Autopilot | 25% | 52% |
| Cloud SQL | 25% | 52% |
| Memorystore | 25% | 52% |
- Go to: Billing → Commitments → Purchase Commitment
- Select resources and term
- Enable auto-renew
Complete Cost Guide
Comprehensive guide with 8 cost reduction strategies
Strategy 3: Development Cost Controls
Auto-shutdown dev clusters after hours:Strategy 4: Database Optimization
Right-size Cloud SQL
Right-size Cloud SQL
Analyze CPU usage:If CPU < 50% consistently, downgrade:
- db-custom-4-15360 → db-custom-2-7680
- Savings: $140/month (50%)
Evaluate Read Replicas
Evaluate Read Replicas
Question: Do you use the read replica?Check connections:If unused, remove:Savings: $140/month
Optimize Backups
Optimize Backups
Reduce retention if compliance allows:Savings: $5-10/month
Strategy 5: Redis Optimization
Right-size memory:- 5 GB → 3 GB: Save $88/month (40%)
- STANDARD_HA → BASIC: Save $110/month (50%)
Cost Monitoring
Set Up Budget Alerts
Alerts fire at 50%, 90%, and 100% of budget
Cost Allocation Labels
Already configured in Terraform:Quick Wins Checklist
1
Use GKE Autopilot
✅ Already configuredSavings: $200-400/month vs. Standard GKE
2
Right-size Pod Resources
3
Purchase 1-year CUD
Console → Billing → CommitmentsSavings: $242/month (25%)
4
Optimize Dev/Staging
- Use zonal clusters (not regional)
- Smaller instances
- Auto-shutdown after hours
5
Enable VPA
Vertical Pod Autoscaler automatically optimizes requests:Savings: 10-30%
Cost Optimization Roadmap
Month 1: Quick Wins ($150-250/month)
- GKE Autopilot (vs. Standard): $200 saved
- Right-size pod resources: $96 saved
- Reduce dev/staging usage: $50 saved
- Optimize log retention: $15 saved
Month 2: Commitments ($200-300/month)
- Purchase 1-year CUD: $242/month saved
- Right-size Cloud SQL: $140 saved (if applicable)
- Optimize Redis tier: $88 saved (if non-critical)
Month 3-6: Advanced ($50-100/month)
- Implement autoscaling schedules
- Optimize network egress
- Cleanup unused resources
- FinOps automation
AWS Cost Optimization
Current vs. Optimized
- Production
- All Environments
| Approach | Monthly Cost | Annual Cost | Savings |
|---|---|---|---|
| Baseline EKS | $1,980 | $23,760 | - |
| Optimized | $803 | $9,636 | 60% |
| + Spot Instances | $688 | $8,256 | 65% |
| + Reserved Instances (1yr) | $545 | $6,540 | 72% |
| + Reserved Instances (3yr) | $425 | $5,100 | 79% |
Strategy 1: Spot Instances (70-90% Savings)
Use spot instances for fault-tolerant workloads:How Spot Instances Save Money
How Spot Instances Save Money
On-Demand Pricing:
- Fixed price, always available
- t3.large: 60.74/month
- Variable price (usually 70-90% discount)
- t3.large: ~18.25/month
- Can be interrupted with 2-minute warning
- Development/staging environments
- Batch processing workloads
- Stateless applications with proper graceful shutdown
- CI/CD build agents
Strategy 2: Reserved Instances & Savings Plans
Commit to 1-year or 3-year usage for significant discounts:| Resource | On-Demand | 1-Year RI | 3-Year RI |
|---|---|---|---|
| EC2 Instances | $0.0832/hr | $0.0540/hr | $0.0416/hr |
| RDS Multi-AZ | $0.165/hr | $0.110/hr | $0.085/hr |
| ElastiCache | $0.075/hr | $0.055/hr | $0.042/hr |
| Discount | - | 35% | 50% |
- Reserved Instances
- Compute Savings Plans
Best for: Predictable, always-running workloads
Strategy 3: Right-Sizing
Analyze and optimize resource allocation:Strategy 4: VPC Endpoints (70% Data Transfer Savings)
Avoid NAT gateway data transfer charges:- NAT Gateway data processing: $0.045/GB
- VPC Endpoint data processing: $0.01/GB
- Savings: $0.035/GB (78%)
Strategy 5: Auto-Scaling
Cluster Autoscaler removes idle nodes:Strategy 6: Development Environment Controls
Stop dev/staging environments after hours:AWS Cost Breakdown
Production Environment ($803/month):| Service | Configuration | Monthly Cost | Optimization |
|---|---|---|---|
| EKS Control Plane | 1 cluster | $73.00 | Required |
| EC2 Nodes | 3×t3.xlarge on-demand | $295.20 | Use 1yr RI: $192 |
| Spot Nodes | 2×t3.large equiv | $14.60 | ✅ Optimized |
| RDS PostgreSQL | db.t3.medium Multi-AZ | $157.56 | Use 1yr RI: $105 |
| ElastiCache | 2×cache.r6g.large | $109.50 | Use 1yr RI: $80 |
| NAT Gateway | 3×Multi-AZ | $97.20 | Required for HA |
| VPC Endpoints | 6 endpoints | $21.60 | Saves $50+ transfer |
| EBS Volumes | 5×100GB gp3 | $40.00 | ✅ Optimized (gp3) |
| CloudWatch | Logs + metrics | $15.00 | Set retention limits |
| Total | $823.66 | With RIs: $545 |
Compute
Compute
Enable spot instances for fault-tolerant workloads
Purchase Reserved Instances for base capacity (35-50% discount)
Deploy Cluster Autoscaler to remove idle nodes
Right-size instance types based on actual utilization
Use HPA to scale pods, not nodes
Stop dev/staging environments after hours
Storage
Storage
Use gp3 instead of gp2 (20% savings + better performance)
Enable RDS storage autoscaling (avoid over-provisioning)
Delete old EBS snapshots (lifecycle policy)
Use S3 lifecycle policies (Standard → IA → Glacier)
Network
Network
Enable VPC endpoints (70% data transfer savings)
Use single NAT gateway in dev/staging
Optimize CloudFront caching to reduce origin requests
Use AWS PrivateLink instead of NAT for AWS services
Database
Database
Purchase RDS Reserved Instances (35-50% discount)
Right-size RDS instance class based on CPU/memory usage
Use Aurora Serverless v2 for variable workloads
Enable automated backup retention limits
Use read replicas only when needed
Monitoring
Monitoring
Set CloudWatch Logs retention (7-30 days, not indefinite)
Use CloudWatch Logs Insights instead of exporting to S3
Enable AWS Cost Explorer and set budgets
Tag all resources for cost allocation
Set up billing alerts (100, $200 thresholds)
AWS Cost Monitoring
Set Up Cost Alerts:Related Documentation
GCP Infrastructure
GCP Terraform modules with cost-optimized defaults
AWS Infrastructure
AWS Terraform modules with cost breakdowns
GKE Production
GCP production deployment with cost estimates
EKS Production
AWS production deployment with cost estimates
Multi-Environment
Dev/staging cost optimization strategies
Complete Guide
Detailed GCP cost optimization strategies