Infrastructure Overview
Serko Northsky uses Pulumi for Infrastructure as Code (IaC) to provision and manage Google Cloud Platform (GCP) resources. This approach enables version-controlled, reproducible infrastructure deployments across multiple environments.
Why Pulumi?
- TypeScript Support: Write infrastructure code in the same language as the application
- State Management: Uses GCS backend for team collaboration without requiring a Pulumi account
- Component-Based: Modular design with reusable infrastructure components
- Multi-Environment: Consistent deployments across dev, test, and production
Architecture Overview
Infrastructure Components
| Component | Purpose |
|---|---|
| Network | VPC, subnets, firewall rules, Cloud NAT |
| GKE | Kubernetes Autopilot cluster |
| Artifact Registry | Docker image repository |
| AlloyDB | Managed PostgreSQL database |
| Memorystore | Redis cache |
| Cloud Storage | Object storage buckets |
| IAM | Service accounts and roles |
| Secrets | Secret Manager configuration |
Environments
The infrastructure supports three environments with environment-specific configurations:
| Environment | GCP Project | Domain | Purpose |
|---|---|---|---|
| Development | serko-northsky-dev | dev.serko-northsky.com | Active development |
| Testing | serko-northsky-test | test.serko-northsky.com | Integration testing |
| Production | northsky-473920 | serko-northsky.com | Live system |
Directory Structure
infra/
├── env.sh # Environment selector script
├── build-and-push.sh # Docker image build script
├── keys/ # Service account keys (git-ignored)
├── pulumi/ # Pulumi IaC
│ ├── Pulumi.yaml # Project configuration
│ ├── Pulumi.dev.yaml # Dev environment config
│ ├── Pulumi.test.yaml # Test environment config
│ ├── Pulumi.prod.yaml # Prod environment config
│ ├── package.json # Dependencies
│ ├── scripts/
│ │ ├── bootstrap.sh # Creates GCS state bucket
│ │ ├── setup-account.sh # Creates GCP service accounts
│ │ └── import-existing.sh # Imports existing resources
│ └── src/
│ ├── index.ts # Main entry point
│ ├── config.ts # Configuration management
│ └── gcp/ # GCP component modules
└── k8s/
└── helm/ # Helm charts for K8s deployment
├── deploy-helm.sh # Deployment script
└── serko-northsky/ # Application chart
Quick Start
# 1. Navigate to infrastructure directory
cd infra
# 2. Select environment
source env.sh dev
# 3. Navigate to Pulumi directory
cd pulumi
# 4. Preview changes
pulumi preview
# 5. Deploy infrastructure
pulumi up
See Prerequisites for detailed setup instructions.