112 lines
2.9 KiB
YAML
112 lines
2.9 KiB
YAML
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: invidious
|
|
namespace: media
|
|
spec:
|
|
strategy:
|
|
type: Recreate
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: invidious
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: invidious
|
|
spec:
|
|
initContainers:
|
|
- name: substitute-config
|
|
image: alpine
|
|
envFrom:
|
|
- secretRef:
|
|
name: invidious-secrets
|
|
command:
|
|
- sh
|
|
- -c
|
|
- apk add gettext && envsubst < /mnt/init/invidious.yml > /mnt/invidious.yml
|
|
volumeMounts:
|
|
- name: invidious-config
|
|
mountPath: /mnt/init/invidious.yml
|
|
subPath: invidious.yml
|
|
- name: tmp
|
|
mountPath: /mnt
|
|
subPath: invidious.yml
|
|
- name: clean-db-dir
|
|
image: busybox
|
|
command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
rm -rf /var/lib/postgresql/data/lost+found
|
|
volumeMounts:
|
|
- name: postgres-data
|
|
mountPath: /var/lib/postgresql/data
|
|
- name: postgres
|
|
image: postgres:15.14
|
|
restartPolicy: Always
|
|
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/data
|
|
- name: inv-companion
|
|
image: quay.io/invidious/invidious-companion@sha256:4320469a01fd3e7f554c8a7ad8d0fd388f325b27cc39a760c64edb36914f06ea
|
|
restartPolicy: Always
|
|
env:
|
|
- name: SERVER_SECRET_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: invidious-secrets
|
|
key: INVIDIOUS_COMPANION_KEY
|
|
securityContext:
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
containers:
|
|
- name: invidious
|
|
image: quay.io/invidious/invidious@sha256:2836b5b8226a53a9cc2afdbd5f5fe6bccdd200f2e17cd92a828b4dc8d8b5cc06
|
|
command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
export INVIDIOUS_CONFIG="$(cat /mnt/invidious.yml)" &&
|
|
exec /invidious/invidious
|
|
env:
|
|
- name: INVIDIOUS_PORT
|
|
value: "3000"
|
|
ports:
|
|
- containerPort: 3000
|
|
volumeMounts:
|
|
- name: logging
|
|
mountPath: /var/log/invidious
|
|
- name: tmp
|
|
mountPath: /mnt
|
|
subPath: invidious.yml
|
|
volumes:
|
|
- name: logging
|
|
emptyDir: {}
|
|
- name: tmp
|
|
emptyDir: {}
|
|
- name: invidious-config
|
|
configMap:
|
|
name: invidious-config
|
|
- name: postgres-data
|
|
persistentVolumeClaim:
|
|
claimName: invidious-longhorn
|