Phase 2: Infrastructure Setup

Duration: 45-60 minutes
Purpose: Deploy core GCP infrastructure via Terraform
Dependencies: Phase 1 complete (all secrets gathered)

Overview

This phase deploys the core infrastructure components using Terraform, including:

  • GKE Autopilot cluster
  • ArgoCD installation with GitLab OAuth
  • Firestore database
  • Firebase Auth
  • Artifact Registry
  • Service accounts with Workload Identity
  • Secret Manager secrets
  • Static IP addresses

📋 Setup Steps

  1. Environment Configuration
  2. Create .env file with all secrets
  3. Configure Terraform variables
  4. Initialize Terraform backend

  5. Infrastructure Deployment

  6. Run Terraform plan and apply
  7. Monitor deployment progress
  8. Record static IP addresses

  9. Post-Deployment Validation

  10. Verify GKE cluster is healthy
  11. Check ArgoCD installation
  12. Validate service account permissions

  13. Troubleshooting

  14. Common deployment issues
  15. Resolution steps
  16. Rollback procedures

🎯 Success Criteria

After completing this phase, you should have:

  1. GKE Cluster - blueberry-dev-cluster running in us-east1
  2. ArgoCD - Installed and configured with GitLab OAuth
  3. Static IP Addresses - Recorded for DNS configuration
  4. Service Accounts - Created with proper IAM roles
  5. Secrets - Stored in Secret Manager
  6. Terraform State - Saved in GCS backend

⏭️ Next Phase

Once infrastructure is deployed and validated, proceed to Phase 3: DNS Configuration

🔧 Key Commands

# Navigate to Terraform directory
cd blueberry-terraform

# Initialize Terraform
make init

# Plan infrastructure changes
make plan

# Apply infrastructure
make apply

# Validate deployment
kubectl get nodes
kubectl get namespaces
kubectl get pods -n argocd

📊 Resources Created

  • GKE Autopilot Cluster: Serverless Kubernetes
  • ArgoCD: GitOps deployment platform
  • Firestore: NoSQL database for application data
  • Firebase Auth: User authentication service
  • Artifact Registry: Container image storage
  • Service Accounts: 4 total (blueberry, gitlab-ci, github-ci, argocd-image-updater)
  • Static IPs: 2 global IPs for ArgoCD and Blueberry
  • Secrets: 5 secrets in Secret Manager

💰 Cost Estimate

  • GKE Autopilot: ~$25-40/month (system components)
  • Firestore: ~$1-5/month (depends on usage)
  • Static IPs: ~$5/month (2 IPs)
  • Total: ~$30-50/month for base infrastructure

📚 Documentation

Document ID: setup/02-infrastructure/README