This commit is contained in:
rainyy21
2026-10-06 01:53:53 -04:00
parent 228f000ae5
commit ef599015b5
9 changed files with 240 additions and 0 deletions
+60
View File
@@ -0,0 +1,60 @@
apiVersion: v1
kind: Service
metadata:
name: db
namespace: rain-hub
spec:
clusterIP: None
selector:
app: db
ports:
- port: 5432
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: db
namespace: rain-hub
spec:
serviceName: db
replicas: 1
selector:
matchLabels:
app: db
template:
metadata:
labels:
app: db
spec:
containers:
- name: postgres
image: postgres:16-alpine
ports:
- containerPort: 5432
envFrom:
- secretRef:
name: rain-hub-secrets
volumeMounts:
- name: pgdata
mountPath: /var/lib/postgresql/data
- name: initdb
mountPath: /docker-entrypoint-initdb.d
readOnly: true
readinessProbe:
exec:
command: ["pg_isready", "-U", "rainhub", "-d", "rainhub"]
initialDelaySeconds: 5
periodSeconds: 5
volumes:
- name: initdb
configMap:
name: db-init
volumeClaimTemplates:
- metadata:
name: pgdata
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: local-path
resources:
requests:
storage: 5Gi