| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- apiVersion: apps/v1
- kind: StatefulSet
- metadata:
- name: postgres
- namespace: {{NAMESPACE}}
- labels:
- app: postgres
- app.kubernetes.io/part-of: claude-code-hub
- spec:
- serviceName: postgres
- replicas: 1
- selector:
- matchLabels:
- app: postgres
- template:
- metadata:
- labels:
- app: postgres
- spec:
- securityContext:
- fsGroup: 999
- containers:
- - name: postgres
- image: postgres:18
- ports:
- - containerPort: 5432
- name: postgres
- env:
- - name: POSTGRES_DB
- value: claude_code_hub
- - name: POSTGRES_USER
- value: claude_code_hub
- - name: POSTGRES_PASSWORD
- valueFrom:
- secretKeyRef:
- name: claude-code-hub-secrets
- key: pg-password
- - name: PGDATA
- value: /var/lib/postgresql/data/pgdata
- - name: TZ
- value: {{TIMEZONE}}
- - name: PGTZ
- value: {{TIMEZONE}}
- args:
- - "-c"
- - "max_connections=200"
- - "-c"
- - "shared_buffers=1GB"
- - "-c"
- - "effective_cache_size=3GB"
- - "-c"
- - "work_mem=16MB"
- - "-c"
- - "maintenance_work_mem=512MB"
- - "-c"
- - "wal_buffers=64MB"
- - "-c"
- - "checkpoint_completion_target=0.9"
- - "-c"
- - "random_page_cost=1.1"
- - "-c"
- - "log_min_duration_statement=1000"
- resources:
- requests:
- cpu: 500m
- memory: 2Gi
- limits:
- cpu: "4"
- memory: 4Gi
- volumeMounts:
- - name: postgres-data
- mountPath: /var/lib/postgresql/data
- livenessProbe:
- exec:
- command:
- - pg_isready
- - "-U"
- - claude_code_hub
- initialDelaySeconds: 30
- periodSeconds: 10
- timeoutSeconds: 5
- readinessProbe:
- exec:
- command:
- - pg_isready
- - "-U"
- - claude_code_hub
- initialDelaySeconds: 5
- periodSeconds: 5
- timeoutSeconds: 3
- volumeClaimTemplates:
- - metadata:
- name: postgres-data
- spec:
- accessModes:
- - ReadWriteOnce
- storageClassName: {{STORAGE_CLASS}}
- resources:
- requests:
- storage: {{PG_STORAGE_SIZE}}
|