new for companion
This commit is contained in:
@@ -14,31 +14,50 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: invidious-db
|
app: invidious-db
|
||||||
spec:
|
spec:
|
||||||
initContainers:
|
|
||||||
- name: init-cleanup
|
|
||||||
image: busybox
|
|
||||||
command: ["rm", "-rf", "/var/lib/postgresql/data/lost+found"]
|
|
||||||
volumeMounts:
|
|
||||||
- name: postgres-data
|
|
||||||
mountPath: /var/lib/postgresql/data
|
|
||||||
containers:
|
containers:
|
||||||
- name: postgres
|
- name: postgres
|
||||||
image: postgres:14
|
image: postgres:14
|
||||||
env:
|
env:
|
||||||
- name: POSTGRES_DB
|
- name: POSTGRES_DB
|
||||||
value: invidious
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: invidious-db-secrets
|
||||||
|
key: postgres-db
|
||||||
- name: POSTGRES_USER
|
- name: POSTGRES_USER
|
||||||
value: kemal
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: invidious-db-secrets
|
||||||
|
key: postgres-user
|
||||||
- name: POSTGRES_PASSWORD
|
- name: POSTGRES_PASSWORD
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: invidious-postgres-secret
|
name: invidious-db-secrets
|
||||||
key: password
|
key: postgres-password
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 5432
|
- containerPort: 5432
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: postgres-data
|
- name: postgres-data
|
||||||
mountPath: /var/lib/postgresql/data
|
mountPath: /var/lib/postgresql/data
|
||||||
|
livenessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- pg_isready
|
||||||
|
- -U
|
||||||
|
- kemal
|
||||||
|
- -d
|
||||||
|
- invidious
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 10
|
||||||
|
readinessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- pg_isready
|
||||||
|
- -U
|
||||||
|
- kemal
|
||||||
|
- -d
|
||||||
|
- invidious
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 10
|
||||||
volumes:
|
volumes:
|
||||||
- name: postgres-data
|
- name: postgres-data
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
|
|||||||
@@ -2,29 +2,40 @@
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: inv-sig-helper
|
name: companion
|
||||||
namespace: default
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: inv-sig-helper
|
app: companion
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: inv-sig-helper
|
app: companion
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: inv-sig-helper
|
- name: companion
|
||||||
image: quay.io/invidious/inv-sig-helper:master-9073c15
|
image: quay.io/invidious/invidious-companion:latest
|
||||||
args: ["--tcp", "0.0.0.0:12999"]
|
|
||||||
env:
|
env:
|
||||||
- name: RUST_LOG
|
- name: SERVER_SECRET_KEY
|
||||||
value: "info"
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: companion-secrets
|
||||||
|
key: server-secret-key
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 12999
|
- containerPort: 8282
|
||||||
securityContext:
|
securityContext:
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
capabilities:
|
capabilities:
|
||||||
drop:
|
drop:
|
||||||
- ALL
|
- ALL
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
volumeMounts:
|
||||||
|
- name: companion-cache
|
||||||
|
mountPath: /var/tmp/youtubei.js
|
||||||
|
subPath: youtubei.js
|
||||||
|
volumes:
|
||||||
|
- name: companion-cache
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: longhorn-invidious-cache
|
||||||
@@ -11,3 +11,17 @@ spec:
|
|||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 1Gi
|
storage: 1Gi
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: longhorn-invidious-cache
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
storageClassName: longhorn
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
---
|
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: invidious-db-service
|
name: invidious-db
|
||||||
namespace: default
|
namespace: invidious
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: invidious-db
|
app: invidious-db
|
||||||
@@ -16,29 +15,15 @@ spec:
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: invidious
|
name: companion
|
||||||
namespace: default
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: invidious
|
app: companion
|
||||||
ports:
|
ports:
|
||||||
- protocol: TCP
|
- protocol: TCP
|
||||||
port: 3000
|
port: 8282
|
||||||
targetPort: 3000
|
targetPort: 8282
|
||||||
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: inv-sig-helper
|
|
||||||
namespace: default
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
app: inv-sig-helper
|
|
||||||
ports:
|
|
||||||
- protocol: TCP
|
|
||||||
port: 12999
|
|
||||||
targetPort: 12999
|
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
|||||||
@@ -14,70 +14,49 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: invidious
|
app: invidious
|
||||||
spec:
|
spec:
|
||||||
initContainers:
|
|
||||||
- name: wait-for-db
|
|
||||||
image: busybox
|
|
||||||
command:
|
|
||||||
- sh
|
|
||||||
- -c
|
|
||||||
- |
|
|
||||||
until nc -z -v -w30 invidious-db-service 5432; do
|
|
||||||
echo "Waiting for database to be ready..."
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
- name: wait-for-helper
|
|
||||||
image: busybox
|
|
||||||
command:
|
|
||||||
- sh
|
|
||||||
- -c
|
|
||||||
- |
|
|
||||||
until nc -z -v -w30 inv-sig-helper 12999; do
|
|
||||||
echo "Waiting for helper to be ready..."
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
containers:
|
containers:
|
||||||
- name: invidious-server
|
- name: invidious
|
||||||
image: quay.io/invidious/invidious:2025.04.04-0c07e9d
|
image: quay.io/invidious/invidious:master
|
||||||
|
env:
|
||||||
|
- name: INVIDIOUS_CONFIG
|
||||||
|
value: |
|
||||||
|
db:
|
||||||
|
dbname: $(POSTGRES_DB)
|
||||||
|
user: $(POSTGRES_USER)
|
||||||
|
password: $(POSTGRES_PASSWORD)
|
||||||
|
host: invidious-db
|
||||||
|
port: 5432
|
||||||
|
check_tables: true
|
||||||
|
invidious_companion:
|
||||||
|
- private_url: "http://companion:8282"
|
||||||
|
public_url: "http://localhost:8282"
|
||||||
|
invidious_companion_key: $(COMPANION_KEY)
|
||||||
|
hmac_key: $(HMAC_KEY)
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: invidious-db-secrets
|
||||||
|
- secretRef:
|
||||||
|
name: invidious-app-secrets
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 3000
|
- containerPort: 3000
|
||||||
env:
|
livenessProbe:
|
||||||
- name: hmac_key
|
httpGet:
|
||||||
valueFrom:
|
path: /api/v1/trending
|
||||||
secretKeyRef:
|
port: 3000
|
||||||
name: invidious-hmac-key
|
initialDelaySeconds: 30
|
||||||
key: key
|
periodSeconds: 30
|
||||||
- name: DB_PASSWORD
|
timeoutSeconds: 5
|
||||||
valueFrom:
|
failureThreshold: 2
|
||||||
secretKeyRef:
|
resources:
|
||||||
name: invidious-postgres-secret
|
limits:
|
||||||
key: password
|
memory: "1Gi"
|
||||||
- name: VISITOR_DATA
|
cpu: "1"
|
||||||
valueFrom:
|
requests:
|
||||||
secretKeyRef:
|
memory: "512Mi"
|
||||||
name: invidious-secret
|
cpu: "500m"
|
||||||
key: visitor-data
|
|
||||||
- name: PO_TOKEN
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: invidious-secret
|
|
||||||
key: po-token
|
|
||||||
- name: INVIDIOUS_CONFIG
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: invidious-config
|
|
||||||
key: config.yml
|
|
||||||
- name: INVIDIOUS_PORT
|
|
||||||
value: "3000"
|
|
||||||
command: ["/bin/sh", "/scripts/start.sh"]
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: config-volume
|
- name: logging
|
||||||
mountPath: /etc/invidious
|
mountPath: /var/log/invidious
|
||||||
- name: scripts-volume
|
|
||||||
mountPath: /scripts
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: config-volume
|
- name: logging
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
- name: scripts-volume
|
|
||||||
configMap:
|
|
||||||
name: invidious-startup-script
|
|
||||||
defaultMode: 0777
|
|
||||||
|
|||||||
Reference in New Issue
Block a user