kubernetes/manifests/hydra/hydra-statefulset.yaml
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: hydra-statefulset
namespace: hm-hydra
labels:
app.kubernetes.io/name: hydra
spec:
serviceName: hydra-service
replicas: 1
selector:
matchLabels:
app: hydra
template:
metadata:
labels:
app: hydra
spec:
containers:
- name: hydra
image: ghcr.io/hydradatabase/hydra:latest
env:
- name: PGDATA
valueFrom:
configMapKeyRef:
name: hydra-configmap
key: pgdata
- name: POSTGRES_DB
valueFrom:
configMapKeyRef:
name: hydra-configmap
key: postgres_db
- name: POSTGRES_USER
valueFrom:
configMapKeyRef:
name: hydra-configmap
key: postgres_user
- name: POSTGRES_PASSWORD
valueFrom:
configMapKeyRef:
name: hydra-configmap
key: postgres_password
args: ["-c", "wal_level=logical"]
ports:
- name: postgres
protocol: TCP
containerPort: 5432
volumeMounts:
- name: postgres-volume
mountPath: /var/lib/postgresql/data
volumeClaimTemplates:
- metadata:
name: postgres-volume
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 1Gi