From 33f94ac7dc1ef24633f8cd87d764763e286e4da4 Mon Sep 17 00:00:00 2001 From: aggarwalakshun Date: Tue, 15 Apr 2025 14:14:03 +0530 Subject: [PATCH] prolly wont work --- cluster/apps/invidious/inv-configmap.yml | 10 ++--- cluster/apps/invidious/invidious.yml | 47 ++++++++++++++++++++++-- 2 files changed, 49 insertions(+), 8 deletions(-) diff --git a/cluster/apps/invidious/inv-configmap.yml b/cluster/apps/invidious/inv-configmap.yml index ba21b00..3a7b495 100644 --- a/cluster/apps/invidious/inv-configmap.yml +++ b/cluster/apps/invidious/inv-configmap.yml @@ -2,19 +2,19 @@ apiVersion: v1 kind: ConfigMap metadata: - name: invidious-config + name: invidious-config-template namespace: default data: - config.yaml: | + config-template.yaml: | db: dbname: invidious user: kemal - password: ${POSTGRES_PASSWORD} + 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} \ No newline at end of file + invidious_companion_key: "__COMPANION_KEY__" + hmac_key: "__HMAC_KEY__" \ No newline at end of file diff --git a/cluster/apps/invidious/invidious.yml b/cluster/apps/invidious/invidious.yml index 759838f..e22f9b9 100644 --- a/cluster/apps/invidious/invidious.yml +++ b/cluster/apps/invidious/invidious.yml @@ -14,6 +14,39 @@ spec: labels: app: invidious spec: + initContainers: + - name: config-generator + image: busybox + command: + - sh + - -c + - | + sed -e "s/__POSTGRES_PASSWORD__/${POSTGRES_PASSWORD}/" \ + -e "s/__COMPANION_KEY__/${COMPANION_KEY}/" \ + -e "s/__HMAC_KEY__/${HMAC_KEY}/" \ + /config-template.yaml > /config/config.yaml + env: + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: invidious-db-secrets + key: postgres-password + - name: COMPANION_KEY + valueFrom: + secretKeyRef: + name: invidious-app-secrets + 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: - name: invidious image: quay.io/invidious/invidious:master @@ -43,6 +76,12 @@ spec: 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: - containerPort: 3000 livenessProbe: @@ -53,9 +92,11 @@ spec: periodSeconds: 30 timeoutSeconds: 5 failureThreshold: 2 - volumeMounts: - - name: logging - mountPath: /var/log/invidious volumes: - name: logging emptyDir: {} + - name: config-template + configMap: + name: invidious-config-template + - name: config + emptyDir: {}