Table of Contents
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
- Environment Configuration
- Create
.env
file with all secrets - Configure Terraform variables
-
Initialize Terraform backend
- Run Terraform plan and apply
- Monitor deployment progress
-
Record static IP addresses
- Verify GKE cluster is healthy
- Check ArgoCD installation
-
Validate service account permissions
- Common deployment issues
- Resolution steps
- Rollback procedures
🎯 Success Criteria
After completing this phase, you should have:
- GKE Cluster -
blueberry-dev-cluster
running in us-east1 - ArgoCD - Installed and configured with GitLab OAuth
- Static IP Addresses - Recorded for DNS configuration
- Service Accounts - Created with proper IAM roles
- Secrets - Stored in Secret Manager
- 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