add companion, configmap, db, ingress, secrets, svc and deployment for invidious

This commit is contained in:
2025-12-28 03:35:01 +05:30
parent 63ff9eca66
commit b8ca404021
8 changed files with 275 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: invidious-db
namespace: media
spec:
selector:
matchLabels:
app: invidious-db
serviceName: invidious-db
replicas: 1
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
volumeClaimTemplates:
- metadata:
name: postgres-data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 1Gi
storageClassName: longhorn