feat: Add PostgreSQL Kubernetes deployment with Kustomize

- Create infrastructure for PostgreSQL StatefulSet in Kubernetes
- Implement environment-specific configurations (staging/production)
- Add Kustomize overlays for deterministic deployments
- Document deployment process in AGENTS.md and infra/k8s/README.md
- Include Makefile and helper scripts for easy management

New directories:
- infra/k8s/base/ - Shared resources (StatefulSet, Service, PVC, Namespace)
- infra/k8s/staging/ - Staging environment overlay
- infra/k8s/production/ - Production environment overlay

Key files:
- infra/k8s/base/kustomization.yaml
- infra/k8s/staging/kustomization.yaml
- infra/k8s/production/kustomization.yaml
- infra/k8s/README.md

Resources are prefixed by environment (staging-, production-) and deployed
to the postgres namespace.
This commit is contained in:
Bobby committed 2026-11-18 15:29:00 -05:00
1 parent 9568d4ca6e
commit 88235fc824
26 files changed
+1407 -14

No files matched your search

+14 -1
View File
@@ -17,9 +17,10 @@ Key differences in v2:
```
infra/
├── backend/ # Terraform state backend (Object Storage S3-compatible)
├── k8s/ # Kubernetes manifests for PostgreSQL StatefulSet
├── network/ # Firewall rules
├── postgres/ # PostgreSQL database instances (LKE clusters)
├── storage/ # Object Storage buckets
├── network/ # Firewall rules
├── main.tf # Main orchestration file
├── providers.tf # Provider configurations
├── variables.tf # Common variables
@@ -87,6 +88,18 @@ terraform apply -var="environment=production"
## Resources Provisioned
### Kubernetes (New)
- StatefulSet for PostgreSQL with persistent storage
- PersistentVolumeClaim for 50Gi of block storage
- Service for internal cluster access
- Kustomize for environment-specific customization
### Kubernetes (New)
- StatefulSet for PostgreSQL with persistent storage
- PersistentVolumeClaim for 50Gi of block storage
- Service for internal cluster access
- Kustomize for environment-specific customization
### PostgreSQL
- LKE (Linode Kubernetes Engine) cluster for staging and production
- Database instances within clusters (`hapi_staging`, `hapi_production`)