2023-04-09 20:19:26 +00:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: StatefulSet
|
|
|
|
metadata:
|
|
|
|
name: postgres
|
|
|
|
spec:
|
|
|
|
replicas: 1
|
|
|
|
serviceName: postgres
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: postgres
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: postgres
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- name: postgres
|
|
|
|
image: postgres:15.2
|
|
|
|
env:
|
|
|
|
- name: POSTGRES_USER
|
|
|
|
valueFrom:
|
|
|
|
configMapKeyRef:
|
|
|
|
name: restserver-config
|
|
|
|
key: DOCSPELL_SERVER_BACKEND_JDBC_USER
|
|
|
|
- name: POSTGRES_PASSWORD
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: restserver-secrets
|
|
|
|
key: DOCSPELL_SERVER_BACKEND_JDBC_PASSWORD
|
|
|
|
- name: POSTGRES_DB
|
|
|
|
value: dbname
|
|
|
|
ports:
|
|
|
|
- name: postgres
|
|
|
|
containerPort: 5432
|
|
|
|
volumeMounts:
|
|
|
|
- name: postgres-data
|
|
|
|
mountPath: /var/lib/postgresql/data
|
2024-02-15 14:54:11 +00:00
|
|
|
subPath: pgdata
|
2023-04-09 20:19:26 +00:00
|
|
|
volumeClaimTemplates:
|
|
|
|
- metadata:
|
|
|
|
name: postgres-data
|
|
|
|
spec:
|
|
|
|
accessModes: [ "ReadWriteOnce" ]
|
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
storage: 1Gi
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
|
|
|
name: postgres
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
app: postgres
|
|
|
|
ports:
|
|
|
|
- name: postgres
|
|
|
|
port: 5432
|
|
|
|
targetPort: postgres
|
2024-02-15 14:54:11 +00:00
|
|
|
clusterIP: None
|