feat: PostgreSQL Kubernetes deployment with Kustomize #36

Merged
bobby merged 1 commits from feat/01b-kubernetes-postgresql-statefulset into main 2026-11-18 15:32:21 -05:00
Owner

PostgreSQL Kubernetes Deployment with Kustomize

Summary

This PR introduces a complete PostgreSQL deployment infrastructure using Kubernetes StatefulSets and Kustomize for environment-specific configurations.

Changes

Infrastructure Structure

  • infra/k8s/base/ - Shared resources (StatefulSet, Service, PVC, Namespace)
  • infra/k8s/staging/ - Staging environment overlay with staging- prefix
  • infra/k8s/production/ - Production environment overlay with production- prefix

Key Files

  • infra/k8s/base/kustomization.yaml - Base resources definition
  • infra/k8s/staging/kustomization.yaml - Staging environment overlay
  • infra/k8s/production/kustomization.yaml - Production environment overlay
  • infra/k8s/README.md - Deployment documentation

Deployment Commands

# 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 deployed to the postgres namespace

Secrets Required

  • postgres-secrets with username and password keys

Testing

Deployed to staging cluster successfully. Resource naming verified with proper prefixes applied.

Related Issues

  • Closes #2 (Kubernetes StatefulSet for Production PostgreSQL)
# PostgreSQL Kubernetes Deployment with Kustomize ## Summary This PR introduces a complete PostgreSQL deployment infrastructure using Kubernetes StatefulSets and Kustomize for environment-specific configurations. ## Changes ### Infrastructure Structure - `infra/k8s/base/` - Shared resources (StatefulSet, Service, PVC, Namespace) - `infra/k8s/staging/` - Staging environment overlay with `staging-` prefix - `infra/k8s/production/` - Production environment overlay with `production-` prefix ### Key Files - `infra/k8s/base/kustomization.yaml` - Base resources definition - `infra/k8s/staging/kustomization.yaml` - Staging environment overlay - `infra/k8s/production/kustomization.yaml` - Production environment overlay - `infra/k8s/README.md` - Deployment documentation ### 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 deployed to the `postgres` namespace ### Secrets Required - `postgres-secrets` with `username` and `password` keys ## Testing Deployed to staging cluster successfully. Resource naming verified with proper prefixes applied. ## Related Issues - Closes #2 (Kubernetes StatefulSet for Production PostgreSQL)
bobby added 1 commit 2026-11-18 15:31:38 -05:00
- 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.
bobby merged commit 741f6e61e9 into main 2026-11-18 15:32:21 -05:00
Sign in to join this conversation.