fix: update invidious deployment and service configurations for consistency and readiness checks
This commit is contained in:
@@ -2,27 +2,24 @@
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: companion
|
name: invidious-companion
|
||||||
namespace: default
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: companion
|
app: invidious-companion
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: companion
|
app: invidious-companion
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: companion
|
- name: invidious-companion
|
||||||
image: quay.io/invidious/invidious-companion:latest
|
image: quay.io/invidious/invidious-companion:latest
|
||||||
env:
|
env:
|
||||||
- name: SERVER_SECRET_KEY
|
- name: SERVER_SECRET_KEY
|
||||||
valueFrom:
|
value: "mtRhvm9wMCJhdnGP"
|
||||||
secretKeyRef:
|
|
||||||
name: companion-secrets
|
|
||||||
key: server-secret-key
|
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8282
|
- containerPort: 8282
|
||||||
securityContext:
|
securityContext:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: invidious-db
|
name: invidious-db-service
|
||||||
namespace: default
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
@@ -15,11 +15,11 @@ spec:
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: companion
|
name: invidious-companion-service
|
||||||
namespace: default
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: companion
|
app: invidious-companion
|
||||||
ports:
|
ports:
|
||||||
- protocol: TCP
|
- protocol: TCP
|
||||||
port: 8282
|
port: 8282
|
||||||
@@ -40,3 +40,19 @@ spec:
|
|||||||
targetPort: 3000
|
targetPort: 3000
|
||||||
nodePort: 3111
|
nodePort: 3111
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: invidious-companion-external-service
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
type: NodePort
|
||||||
|
selector:
|
||||||
|
app: invidious-companion
|
||||||
|
ports:
|
||||||
|
- port: 8282
|
||||||
|
targetPort: 8282
|
||||||
|
nodePort: 8282
|
||||||
|
protocol: TCP
|
||||||
|
|||||||
@@ -15,73 +15,46 @@ spec:
|
|||||||
app: invidious
|
app: invidious
|
||||||
spec:
|
spec:
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: config-generator
|
- name: wait-for-companion
|
||||||
image: busybox
|
image: busybox
|
||||||
command:
|
command:
|
||||||
- sh
|
- sh
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
sed -e "s/__POSTGRES_PASSWORD__/${POSTGRES_PASSWORD}/" \
|
until nc -z -v -w30 invidious-companion-service 8282; do
|
||||||
-e "s/__COMPANION_KEY__/${COMPANION_KEY}/" \
|
echo "Waiting for companion to be ready..."
|
||||||
-e "s/__HMAC_KEY__/${HMAC_KEY}/" \
|
sleep 2
|
||||||
/config-template.yaml > /config/config.yaml
|
done
|
||||||
env:
|
- name: wait-for-db
|
||||||
- name: POSTGRES_PASSWORD
|
image: busybox
|
||||||
valueFrom:
|
command:
|
||||||
secretKeyRef:
|
- sh
|
||||||
name: invidious-db-secrets
|
- -c
|
||||||
key: postgres-password
|
- |
|
||||||
- name: COMPANION_KEY
|
until nc -z -v -w30 invidious-db-service 5432; do
|
||||||
valueFrom:
|
echo "Waiting for database to be ready..."
|
||||||
secretKeyRef:
|
sleep 2
|
||||||
name: invidious-app-secrets
|
done
|
||||||
key: companion-key
|
|
||||||
- name: HMAC_KEY
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: invidious-app-secrets
|
|
||||||
key: hmac-key
|
|
||||||
volumeMounts:
|
|
||||||
- name: config-template
|
|
||||||
mountPath: /config-template.yaml
|
|
||||||
subPath: config-template.yaml
|
|
||||||
- name: config
|
|
||||||
mountPath: /config
|
|
||||||
containers:
|
containers:
|
||||||
- name: invidious
|
- name: invidious
|
||||||
image: quay.io/invidious/invidious:master
|
image: quay.io/invidious/invidious:master
|
||||||
env:
|
env:
|
||||||
- name: INVIDIOUS_CONFIG
|
- name: INVIDIOUS_CONFIG
|
||||||
valueFrom:
|
value: |
|
||||||
configMapKeyRef:
|
db:
|
||||||
name: invidious-config
|
dbname: invidious
|
||||||
key: config.yaml
|
user: kemal
|
||||||
- name: POSTGRES_PASSWORD
|
password: akshun@9501
|
||||||
valueFrom:
|
host: invidious-db-service
|
||||||
secretKeyRef:
|
port: 5432
|
||||||
name: invidious-db-secrets
|
check_tables: true
|
||||||
key: postgres-password
|
invidious_companion:
|
||||||
- name: COMPANION_KEY
|
- private_url: "http://invidious-companion-service:8282"
|
||||||
valueFrom:
|
public_url: "http://192.168.1.120:8282"
|
||||||
secretKeyRef:
|
invidious_companion_key: "mtRhvm9wMCJhdnGP"
|
||||||
name: invidious-app-secrets
|
hmac_key: "qp/GnTJs5KCB8Ma8"
|
||||||
key: companion-key
|
- name: INVIDIOUS_PORT
|
||||||
- name: HMAC_KEY
|
value: "3000"
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: invidious-app-secrets
|
|
||||||
key: hmac-key
|
|
||||||
envFrom:
|
|
||||||
- secretRef:
|
|
||||||
name: invidious-db-secrets
|
|
||||||
- secretRef:
|
|
||||||
name: invidious-app-secrets
|
|
||||||
volumeMounts:
|
|
||||||
- name: config
|
|
||||||
mountPath: /app/config.yaml
|
|
||||||
subPath: config.yaml
|
|
||||||
- name: logging
|
|
||||||
mountPath: /var/log/invidious
|
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 3000
|
- containerPort: 3000
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
@@ -92,11 +65,10 @@ spec:
|
|||||||
periodSeconds: 30
|
periodSeconds: 30
|
||||||
timeoutSeconds: 5
|
timeoutSeconds: 5
|
||||||
failureThreshold: 2
|
failureThreshold: 2
|
||||||
|
volumeMounts:
|
||||||
|
- name: logging
|
||||||
|
mountPath: /var/log/invidious
|
||||||
volumes:
|
volumes:
|
||||||
- name: logging
|
- name: logging
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
- name: config-template
|
|
||||||
configMap:
|
|
||||||
name: invidious-config-template
|
|
||||||
- name: config
|
|
||||||
emptyDir: {}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user