workspace/projects/gamilit/k8s/database/statefulset.yaml
rckrdmrd ea1879f4ad feat: Initial workspace structure with multi-level Git configuration
- Configure workspace Git repository with comprehensive .gitignore
- Add Odoo as submodule for ERP reference code
- Include documentation: SETUP.md, GIT-STRUCTURE.md
- Add gitignore templates for projects (backend, frontend, database)
- Structure supports independent repos per project/subproject level

Workspace includes:
- core/ - Reusable patterns, modules, orchestration system
- projects/ - Active projects (erp-suite, gamilit, trading-platform, etc.)
- knowledge-base/ - Reference code and patterns (includes Odoo submodule)
- devtools/ - Development tools and templates
- customers/ - Client implementations template

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 10:44:23 -06:00

119 lines
3.0 KiB
YAML

# =============================================================================
# GAMILIT Database - PostgreSQL StatefulSet
# =============================================================================
# Purpose: Deploys PostgreSQL as a StatefulSet with persistent storage
# NOTE: For production, consider using managed database (AWS RDS, GCP Cloud SQL)
# This is for self-hosted Kubernetes deployment
# =============================================================================
apiVersion: v1
kind: Service
metadata:
name: gamilit-postgres
namespace: gamilit-production
labels:
app: gamilit
component: database
spec:
type: ClusterIP
clusterIP: None # Headless service for StatefulSet
selector:
app: gamilit
component: database
ports:
- name: postgresql
port: 5432
targetPort: 5432
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: gamilit-postgres
namespace: gamilit-production
labels:
app: gamilit
component: database
spec:
serviceName: gamilit-postgres
replicas: 1
selector:
matchLabels:
app: gamilit
component: database
template:
metadata:
labels:
app: gamilit
component: database
spec:
containers:
- name: postgresql
image: postgres:16-alpine
imagePullPolicy: IfNotPresent
ports:
- name: postgresql
containerPort: 5432
env:
- name: POSTGRES_DB
value: "gamilit_platform"
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: gamilit-db-secret
key: username
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: gamilit-db-secret
key: password
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
resources:
requests:
cpu: 500m
memory: 1Gi
limits:
cpu: 1000m
memory: 2Gi
livenessProbe:
exec:
command:
- /bin/sh
- -c
- pg_isready -U $POSTGRES_USER -d $POSTGRES_DB
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
exec:
command:
- /bin/sh
- -c
- pg_isready -U $POSTGRES_USER -d $POSTGRES_DB
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 3
volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql/data
volumeClaimTemplates:
- metadata:
name: postgres-data
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: "standard" # Adjust based on your cluster
resources:
requests:
storage: 100Gi