Skip to main content

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

ComponentPurpose
NetworkVPC, subnets, firewall rules, Cloud NAT
GKEKubernetes Autopilot cluster
Artifact RegistryDocker image repository
AlloyDBManaged PostgreSQL database
MemorystoreRedis cache
Cloud StorageObject storage buckets
IAMService accounts and roles
SecretsSecret Manager configuration

Environments

The infrastructure supports three environments with environment-specific configurations:

EnvironmentGCP ProjectDomainPurpose
Developmentserko-northsky-devdev.serko-northsky.comActive development
Testingserko-northsky-testtest.serko-northsky.comIntegration testing
Productionnorthsky-473920serko-northsky.comLive 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.