Files
pipeline_backend/k8s/postgres.yaml
2026-06-24 18:58:35 +03:00

85 lines
1.7 KiB
YAML

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-data
namespace: audio-pipeline
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
storageClassName: local-path
---
apiVersion: v1
kind: Service
metadata:
name: postgres
namespace: audio-pipeline
spec:
selector:
app: postgres
ports:
- name: postgres
port: 5432
targetPort: 5432
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
namespace: audio-pipeline
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:16-alpine
ports:
- containerPort: 5432
envFrom:
- secretRef:
name: app-secrets
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
- name: init
mountPath: /docker-entrypoint-initdb.d
readOnly: true
readinessProbe:
exec:
command:
- pg_isready
- -U
- pipeline
- -d
- pipeline
initialDelaySeconds: 5
periodSeconds: 5
livenessProbe:
exec:
command:
- pg_isready
- -U
- pipeline
- -d
- pipeline
initialDelaySeconds: 15
periodSeconds: 10
volumes:
- name: data
persistentVolumeClaim:
claimName: postgres-data
- name: init
configMap:
name: postgres-init