use statefulSets and readinessProbes instead of initContainers
This commit is contained in:
@@ -10,10 +10,10 @@ data:
|
||||
dbname: invidious
|
||||
user: kemal
|
||||
password: ${INVIDIOUS_DB_PASSWORD}
|
||||
host: invidious-db-service
|
||||
host: invidious-db.media.svc.cluster.local
|
||||
port: 5432
|
||||
check_tables: true
|
||||
invidious_companion:
|
||||
- private_url: "http://invidious-companion-service:8282/companion"
|
||||
- private_url: "http://invidious-companion-service.media.svc.cluster.local:8282/companion"
|
||||
invidious_companion_key: ${INVIDIOUS_COMPANION_KEY}
|
||||
hmac_key: ${INVIDIOUS_HMAC_KEY}
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: invidious-db
|
||||
namespace: media
|
||||
spec:
|
||||
strategy:
|
||||
type: Recreate
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: invidious-db
|
||||
serviceName: invidious-db
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
@@ -49,7 +48,12 @@ spec:
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql
|
||||
volumes:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
claimName: invidious-longhorn
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: postgres-data
|
||||
spec:
|
||||
accessModes: ["ReadWriteOnce"]
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storageClassName: longhorn
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: invidious-longhorn
|
||||
namespace: media
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeMode: Filesystem
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storageClassName: longhorn
|
||||
@@ -33,7 +33,7 @@ spec:
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: invidious-db-service
|
||||
name: invidious-db
|
||||
namespace: media
|
||||
spec:
|
||||
selector:
|
||||
@@ -41,3 +41,4 @@ spec:
|
||||
ports:
|
||||
- port: 5432
|
||||
targetPort: 5432
|
||||
clusterIP: None
|
||||
|
||||
@@ -33,28 +33,6 @@ spec:
|
||||
- name: tmp
|
||||
mountPath: /mnt
|
||||
subPath: invidious.yml
|
||||
- name: wait-for-db
|
||||
image: busybox
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
until nc -z -v -w30 invidious-db-service 5432
|
||||
do
|
||||
echo "Waiting for database connection..."
|
||||
sleep 5
|
||||
done
|
||||
- name: wait-for-companion
|
||||
image: busybox
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
until nc -z -v -w30 invidious-companion-service 8282
|
||||
do
|
||||
echo "Waiting for invidious companion connection..."
|
||||
sleep 5
|
||||
done
|
||||
containers:
|
||||
- name: invidious
|
||||
image: quay.io/invidious/invidious@sha256:2836b5b8226a53a9cc2afdbd5f5fe6bccdd200f2e17cd92a828b4dc8d8b5cc06
|
||||
@@ -64,6 +42,13 @@ spec:
|
||||
- |
|
||||
export INVIDIOUS_CONFIG="$(cat /mnt/invidious.yml)" &&
|
||||
exec /invidious/invidious
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
nc -z invidious-db.media.svc.cluster.local 5432 && nc -z invidious-companion-service.media.svc.cluster.local 8282
|
||||
env:
|
||||
- name: INVIDIOUS_PORT
|
||||
value: "3000"
|
||||
|
||||
Reference in New Issue
Block a user