use statefulSets and readinessProbes instead of initContainers
This commit is contained in:
@@ -10,10 +10,10 @@ data:
|
|||||||
dbname: invidious
|
dbname: invidious
|
||||||
user: kemal
|
user: kemal
|
||||||
password: ${INVIDIOUS_DB_PASSWORD}
|
password: ${INVIDIOUS_DB_PASSWORD}
|
||||||
host: invidious-db-service
|
host: invidious-db.media.svc.cluster.local
|
||||||
port: 5432
|
port: 5432
|
||||||
check_tables: true
|
check_tables: true
|
||||||
invidious_companion:
|
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}
|
invidious_companion_key: ${INVIDIOUS_COMPANION_KEY}
|
||||||
hmac_key: ${INVIDIOUS_HMAC_KEY}
|
hmac_key: ${INVIDIOUS_HMAC_KEY}
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: StatefulSet
|
||||||
metadata:
|
metadata:
|
||||||
name: invidious-db
|
name: invidious-db
|
||||||
namespace: media
|
namespace: media
|
||||||
spec:
|
spec:
|
||||||
strategy:
|
|
||||||
type: Recreate
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: invidious-db
|
app: invidious-db
|
||||||
|
serviceName: invidious-db
|
||||||
|
replicas: 1
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -49,7 +48,12 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: postgres-data
|
- name: postgres-data
|
||||||
mountPath: /var/lib/postgresql
|
mountPath: /var/lib/postgresql
|
||||||
volumes:
|
volumeClaimTemplates:
|
||||||
- name: postgres-data
|
- metadata:
|
||||||
persistentVolumeClaim:
|
name: postgres-data
|
||||||
claimName: invidious-longhorn
|
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
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: invidious-db-service
|
name: invidious-db
|
||||||
namespace: media
|
namespace: media
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
@@ -41,3 +41,4 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- port: 5432
|
- port: 5432
|
||||||
targetPort: 5432
|
targetPort: 5432
|
||||||
|
clusterIP: None
|
||||||
|
|||||||
@@ -33,28 +33,6 @@ spec:
|
|||||||
- name: tmp
|
- name: tmp
|
||||||
mountPath: /mnt
|
mountPath: /mnt
|
||||||
subPath: invidious.yml
|
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:
|
containers:
|
||||||
- name: invidious
|
- name: invidious
|
||||||
image: quay.io/invidious/invidious@sha256:2836b5b8226a53a9cc2afdbd5f5fe6bccdd200f2e17cd92a828b4dc8d8b5cc06
|
image: quay.io/invidious/invidious@sha256:2836b5b8226a53a9cc2afdbd5f5fe6bccdd200f2e17cd92a828b4dc8d8b5cc06
|
||||||
@@ -64,6 +42,13 @@ spec:
|
|||||||
- |
|
- |
|
||||||
export INVIDIOUS_CONFIG="$(cat /mnt/invidious.yml)" &&
|
export INVIDIOUS_CONFIG="$(cat /mnt/invidious.yml)" &&
|
||||||
exec /invidious/invidious
|
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:
|
env:
|
||||||
- name: INVIDIOUS_PORT
|
- name: INVIDIOUS_PORT
|
||||||
value: "3000"
|
value: "3000"
|
||||||
|
|||||||
Reference in New Issue
Block a user