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:
1 parent
9568d4ca6e
commit
88235fc824
26 files changed
+1407
-14
No files matched your search
@@ -21,12 +21,46 @@ Single-context layout: `GLOSSARY.md` at repo root and `docs/adr/` for architectu
|
||||
The `infra/` directory contains Terraform configurations with these modules:
|
||||
|
||||
- `backend/` - Terraform state backend (Object Storage S3-compatible)
|
||||
- `k8s/` - PostgreSQL StatefulSet with persistent storage and Kubernetes manifests
|
||||
- `network/` - Firewall rules for API (8000), PostgreSQL (5432), Adminer (8080)
|
||||
- `postgres/` - LKE clusters for staging/production
|
||||
- `storage/` - Object Storage buckets for uploads and state
|
||||
- `network/` - Firewall rules for API (8000), PostgreSQL (5432), Adminer (8080)
|
||||
|
||||
See `infra/README.md` and `docs/adr/0002-linode-provider-v2-migration.md` for details.
|
||||
|
||||
### Kubernetes Deployments
|
||||
|
||||
PostgreSQL is deployed using Kustomize with environment-specific configurations:
|
||||
|
||||
- **Base** (`infra/k8s/base/`) - Shared resources (StatefulSet, Service, PVC, Namespace)
|
||||
- **Staging** (`infra/k8s/staging/`) - Staging environment overlay with `staging-` prefix
|
||||
- **Production** (`infra/k8s/production/`) - Production environment overlay with `production-` prefix
|
||||
|
||||
**Deployment commands:**
|
||||
|
||||
```bash
|
||||
# Staging
|
||||
kubectl apply -k infra/k8s/staging
|
||||
|
||||
# Production
|
||||
kubectl apply -k infra/k8s/production
|
||||
|
||||
# Dry run
|
||||
kubectl apply -k infra/k8s/staging --dry-run=client
|
||||
```
|
||||
|
||||
**Resource naming:**
|
||||
|
||||
- Staging resources are prefixed with `staging-`
|
||||
- Production resources are prefixed with `production-`
|
||||
- All resources go to the `postgres` namespace
|
||||
|
||||
**Secrets required:**
|
||||
|
||||
- `postgres-secrets` with `username` and `password` keys
|
||||
|
||||
See `infra/k8s/README.md` for more details.
|
||||
|
||||
## Provider Versions
|
||||
|
||||
### Linode Terraform Provider
|
||||
|
||||
Reference in new issue
Block a user