From 63cd13f25e1c8c48cae5e095807c85e4bf9f4a64 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Thu, 19 Mar 2026 10:39:59 +0100 Subject: [PATCH] Allow more volumes --- chart/templates/api/deployment.yaml | 16 ++++++++++++++- chart/templates/auth/deployment.yaml | 24 +++++++++++++++++----- chart/templates/front/deployment.yaml | 20 +++++++++++++----- chart/templates/scanner/deployment.yaml | 14 +++++++++++++ chart/templates/transcoder/deployment.yaml | 14 +++++++++++++ chart/values.yaml | 4 ++++ 6 files changed, 81 insertions(+), 11 deletions(-) diff --git a/chart/templates/api/deployment.yaml b/chart/templates/api/deployment.yaml index 5880280c..270d2142 100644 --- a/chart/templates/api/deployment.yaml +++ b/chart/templates/api/deployment.yaml @@ -14,7 +14,7 @@ metadata: spec: replicas: {{ .Values.api.replicaCount }} {{- with .Values.api.updateStrategy }} - strategy: + strategy: {{- toYaml . | nindent 4 }} {{- end }} selector: @@ -63,15 +63,23 @@ spec: - name: IMAGES_PATH value: "/images" - name: PGUSER + {{- if .Values.global.postgres.shared.userOverride }} + value: {{ .Values.global.postgres.shared.userOverride | quote }} + {{- else }} valueFrom: secretKeyRef: key: {{ default .Values.global.postgres.shared.userKey .Values.global.postgres.kyoo_api.kyoo_api.userKey }} name: {{ default .Values.global.postgres.shared.existingSecret .Values.global.postgres.kyoo_api.kyoo_api.existingSecret }} + {{- end }} - name: PGPASSWORD + {{- if .Values.global.postgres.shared.passwordOverride }} + value: {{ .Values.global.postgres.shared.passwordOverride | quote }} + {{- else }} valueFrom: secretKeyRef: key: {{ default .Values.global.postgres.shared.passwordKey .Values.global.postgres.kyoo_api.kyoo_api.passwordKey }} name: {{ default .Values.global.postgres.shared.existingSecret .Values.global.postgres.kyoo_api.kyoo_api.existingSecret }} + {{- end }} - name: PGDATABASE value: {{ default .Values.global.postgres.kyoo_api.database .Values.global.postgres.shared.databaseOverride | quote }} - name: PGHOST @@ -108,6 +116,9 @@ spec: - name: apiimagedata mountPath: /images {{- end }} + {{- with .Values.global.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} {{- with .Values.api.kyoo_api.volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} @@ -129,6 +140,9 @@ spec: claimName: {{ include "kyoo.apiimagedata.fullname" . }} {{- end }} {{- end }} + {{- with .Values.global.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.api.volumes }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/chart/templates/auth/deployment.yaml b/chart/templates/auth/deployment.yaml index 1656869b..5090b6ea 100644 --- a/chart/templates/auth/deployment.yaml +++ b/chart/templates/auth/deployment.yaml @@ -14,7 +14,7 @@ metadata: spec: replicas: {{ .Values.auth.replicaCount }} {{- with .Values.auth.updateStrategy }} - strategy: + strategy: {{- toYaml . | nindent 4 }} {{- end }} selector: @@ -79,15 +79,23 @@ spec: value: {{ $entry.claims | quote }} {{- end }} - name: PGUSER + {{- if .Values.global.postgres.shared.userOverride }} + value: {{ .Values.global.postgres.shared.userOverride | quote }} + {{- else }} valueFrom: secretKeyRef: key: {{ default .Values.global.postgres.shared.userKey .Values.global.postgres.kyoo_auth.kyoo_auth.userKey }} name: {{ default .Values.global.postgres.shared.existingSecret .Values.global.postgres.kyoo_auth.kyoo_auth.existingSecret }} + {{- end }} - name: PGPASSWORD + {{- if .Values.global.postgres.shared.passwordOverride }} + value: {{ .Values.global.postgres.shared.passwordOverride | quote }} + {{- else }} valueFrom: secretKeyRef: key: {{ default .Values.global.postgres.shared.passwordKey .Values.global.postgres.kyoo_auth.kyoo_auth.passwordKey }} name: {{ default .Values.global.postgres.shared.existingSecret .Values.global.postgres.kyoo_auth.kyoo_auth.existingSecret }} + {{- end }} - name: PGDATABASE value: {{ default .Values.global.postgres.kyoo_auth.database .Values.global.postgres.shared.databaseOverride | quote }} - name: PGHOST @@ -149,10 +157,13 @@ spec: securityContext: {{- toYaml . | nindent 12 }} {{- end }} - {{- if or .Values.auth.kyoo_auth.extraVolumeMounts .Values.kyoo.auth.privatekey.existingSecret }} + {{- if or .Values.global.extraVolumeMounts .Values.auth.kyoo_auth.extraVolumeMounts .Values.kyoo.auth.privatekey.existingSecret }} volumeMounts: + {{- with .Values.global.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} {{- with .Values.auth.kyoo_auth.extraVolumeMounts }} - {{- toYaml . | nindent 12 }} + {{- toYaml . | nindent 12 }} {{- end }} {{- if .Values.kyoo.auth.privatekey.existingSecret }} - name: private-key @@ -167,10 +178,13 @@ spec: initContainers: {{- tpl (toYaml .) $ | nindent 6 }} {{- end }} - {{- if or .Values.auth.extraVolumes .Values.kyoo.auth.privatekey.existingSecret }} + {{- if or .Values.global.extraVolumes .Values.auth.extraVolumes .Values.kyoo.auth.privatekey.existingSecret }} volumes: + {{- with .Values.global.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.auth.extraVolumes }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.kyoo.auth.privatekey.existingSecret }} - name: private-key diff --git a/chart/templates/front/deployment.yaml b/chart/templates/front/deployment.yaml index 5343216d..005070d1 100644 --- a/chart/templates/front/deployment.yaml +++ b/chart/templates/front/deployment.yaml @@ -14,7 +14,7 @@ metadata: spec: replicas: {{ .Values.front.replicaCount }} {{- with .Values.front.updateStrategy }} - strategy: + strategy: {{- toYaml . | nindent 4 }} {{- end }} selector: @@ -77,9 +77,14 @@ spec: securityContext: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.front.kyoo_front.extraVolumeMounts }} + {{- if or .Values.global.extraVolumeMounts .Values.front.kyoo_front.extraVolumeMounts }} volumeMounts: - {{- toYaml . | nindent 12 }} + {{- with .Values.global.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.front.kyoo_front.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} {{- end }} {{- with .Values.front.extraContainers }} {{- tpl (toYaml .) $ | nindent 8 }} @@ -88,7 +93,12 @@ spec: initContainers: {{- tpl (toYaml .) $ | nindent 6 }} {{- end }} - {{- with .Values.front.extraVolumes }} + {{- if or .Values.global.extraVolumes .Values.front.extraVolumes }} volumes: - {{- toYaml . | nindent 8 }} + {{- with .Values.global.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.front.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} \ No newline at end of file diff --git a/chart/templates/scanner/deployment.yaml b/chart/templates/scanner/deployment.yaml index 7862acc4..37a826aa 100644 --- a/chart/templates/scanner/deployment.yaml +++ b/chart/templates/scanner/deployment.yaml @@ -74,15 +74,23 @@ spec: name: {{ .Values.contentdatabase.tmdb.existingSecret }} optional: true - name: PGUSER + {{- if .Values.global.postgres.shared.userOverride }} + value: {{ .Values.global.postgres.shared.userOverride | quote }} + {{- else }} valueFrom: secretKeyRef: key: {{ default .Values.global.postgres.shared.userKey .Values.global.postgres.kyoo_scanner.kyoo_scanner.userKey }} name: {{ default .Values.global.postgres.shared.existingSecret .Values.global.postgres.kyoo_scanner.kyoo_scanner.existingSecret }} + {{- end }} - name: PGPASSWORD + {{- if .Values.global.postgres.shared.passwordOverride }} + value: {{ .Values.global.postgres.shared.passwordOverride | quote }} + {{- else }} valueFrom: secretKeyRef: key: {{ default .Values.global.postgres.shared.passwordKey .Values.global.postgres.kyoo_scanner.kyoo_scanner.passwordKey }} name: {{ default .Values.global.postgres.shared.existingSecret .Values.global.postgres.kyoo_scanner.kyoo_scanner.existingSecret }} + {{- end }} - name: PGDATABASE value: {{ default .Values.global.postgres.kyoo_scanner.database .Values.global.postgres.shared.databaseOverride | quote }} - name: PGHOST @@ -115,6 +123,9 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} volumeMounts: + {{- with .Values.global.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} {{- with .Values.media.volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} @@ -129,6 +140,9 @@ spec: {{- tpl (toYaml .) $ | nindent 6 }} {{- end }} volumes: + {{- with .Values.global.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.media.volumes }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/chart/templates/transcoder/deployment.yaml b/chart/templates/transcoder/deployment.yaml index 03ea6334..36e1458d 100644 --- a/chart/templates/transcoder/deployment.yaml +++ b/chart/templates/transcoder/deployment.yaml @@ -81,15 +81,23 @@ spec: - name: GOCODER_SAFE_PATH value: {{ .Values.media.baseMountPath | quote }} - name: PGUSER + {{- if .Values.global.postgres.shared.userOverride }} + value: {{ .Values.global.postgres.shared.userOverride | quote }} + {{- else }} valueFrom: secretKeyRef: key: {{ default .Values.global.postgres.shared.userKey .Values.global.postgres.kyoo_transcoder.kyoo_transcoder.userKey }} name: {{ default .Values.global.postgres.shared.existingSecret .Values.global.postgres.kyoo_transcoder.kyoo_transcoder.existingSecret }} + {{- end }} - name: PGPASSWORD + {{- if .Values.global.postgres.shared.passwordOverride }} + value: {{ .Values.global.postgres.shared.passwordOverride | quote }} + {{- else }} valueFrom: secretKeyRef: key: {{ default .Values.global.postgres.shared.passwordKey .Values.global.postgres.kyoo_transcoder.kyoo_transcoder.passwordKey }} name: {{ default .Values.global.postgres.shared.existingSecret .Values.global.postgres.kyoo_transcoder.kyoo_transcoder.existingSecret }} + {{- end }} - name: PGDATABASE value: {{ default .Values.global.postgres.kyoo_transcoder.database .Values.global.postgres.shared.databaseOverride | quote }} - name: PGHOST @@ -122,6 +130,9 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} volumeMounts: + {{- with .Values.global.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} {{- with .Values.media.volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} @@ -143,6 +154,9 @@ spec: {{- tpl (toYaml .) $ | nindent 6 }} {{- end }} volumes: + {{- with .Values.global.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.media.volumes }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/chart/values.yaml b/chart/values.yaml index a06c04d9..613d8848 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -14,6 +14,8 @@ global: podAnnotations: {} podLabels: {} extraEnv: [] + extraVolumes: [] + extraVolumeMounts: [] # kyoo connectivity & subchart settings for postgres # subchart configuration can be found at .postgresql @@ -33,6 +35,8 @@ global: port: 5432 # setting the database here will override the other database settings databaseOverride: ~ + userOverride: ~ + passwordOverride: ~ # base setting for specifying existingSecret for all kyoo workloads existingSecret: bigsecret # base setting for specifying userKey for all kyoo workloads