Files
k3s-at-home/clusters/default/media/invidious/invidious-db.yml

56 lines
1.3 KiB
YAML

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: invidious-db
namespace: media
spec:
strategy:
type: Recreate
replicas: 1
selector:
matchLabels:
app: invidious-db
template:
metadata:
labels:
app: invidious-db
spec:
initContainers:
- name: clean-db-dir
image: busybox
command:
- sh
- -c
- |
rm -rf /var/lib/postgresql/lost+found
volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql
containers:
- name: postgres
image: postgres:18
env:
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: invidious-db-secrets
key: postgres-db
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: invidious-db-secrets
key: postgres-user
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: invidious-db-secrets
key: postgres-password
volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql
volumes:
- name: postgres-data
persistentVolumeClaim:
claimName: invidious-longhorn