From 7d946bd4b18aed842d2b3c8a897f785fdd108f41 Mon Sep 17 00:00:00 2001 From: holysoles Date: Fri, 17 Jan 2025 13:41:25 -0600 Subject: [PATCH] fix(chart): access subchart generated values properly --- charts/pixelfed/templates/deployment.yaml | 76 +++++++++++------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/charts/pixelfed/templates/deployment.yaml b/charts/pixelfed/templates/deployment.yaml index 84c6105..c53cbd6 100644 --- a/charts/pixelfed/templates/deployment.yaml +++ b/charts/pixelfed/templates/deployment.yaml @@ -179,34 +179,35 @@ spec: # redis - name: REDIS_HOST + {{- if .Values.externalValkey.existingSecret }} valueFrom: secretKeyRef: - {{- if .Values.externalValkey.existingSecret }} name: {{ .Values.externalValkey.existingSecret }} key: {{ .Values.externalValkey.existingSecretKeys.host }} - {{- else }} - name: pixelfed-valkey - key: host - {{- end }} + {{- else }} + value: {{ printf "%s-primary" (.Values.valkey.fullnameOverride) }} + {{- end }} - name: REDIS_PORT + {{- if .Values.externalValkey.existingSecret }} valueFrom: secretKeyRef: - {{- if .Values.externalValkey.existingSecret }} name: {{ .Values.externalValkey.existingSecret }} key: {{ .Values.externalValkey.existingSecretKeys.port }} - {{- else }} - name: pixelfed-valkey - key: port - {{- end }} + {{- else }} + value: {{ .Values.valkey.primary.service.ports.valkey | quote }} + {{- end }} - name: REDIS_PASSWORD valueFrom: secretKeyRef: {{- if .Values.externalValkey.existingSecret }} name: {{ .Values.externalValkey.existingSecret }} key: {{ .Values.externalValkey.existingSecretKeys.password }} - {{- else }} - name: pixelfed-valkey + {{- else if .Values.valkey.auth.existingSecret }} + name: {{ .Values.valkey.auth.existingSecret }} key: password + {{- else }} + name: {{ .Values.valkey.fullnameOverride }} + key: valkey-password {{- end }} # mail @@ -263,55 +264,54 @@ spec: - name: DB_CONNECTION value: {{ .Values.externalDatabase.connection }} - name: DB_HOST + {{- if .Values.externalDatabase.existingSecret }} valueFrom: secretKeyRef: - {{- if .Values.externalDatabase.existingSecret }} name: {{ .Values.externalDatabase.existingSecret }} - key: {{ .Values.externalDatabase.existingSecretKeys.username }} - {{- else }} - name: pixelfed-database - key: host - {{- end }} + key: {{ .Values.externalDatabase.existingSecretKeys.host }} + {{- else }} + value: {{ .Values.postgresql.fullnameOverride }} + {{- end }} - name: DB_USERNAME + {{- if .Values.externalDatabase.existingSecret }} valueFrom: secretKeyRef: - {{- if .Values.externalDatabase.existingSecret }} name: {{ .Values.externalDatabase.existingSecret }} key: {{ .Values.externalDatabase.existingSecretKeys.username }} - {{- else }} - name: pixelfed-database - key: username - {{- end }} + {{- else }} + value: postgres + {{- end }} - name: DB_PASSWORD valueFrom: secretKeyRef: {{- if .Values.externalDatabase.existingSecret }} name: {{ .Values.externalDatabase.existingSecret }} - key: {{ .Values.externalDatabase.existingSecretKeys.username }} + key: {{ .Values.externalDatabase.existingSecretKeys.password }} + {{- else if .Values.postgresql.auth.existingSecret }} + name: {{ .Values.postgresql.auth.existingSecret }} + key: postgres-password {{- else }} - name: pixelfed-database - key: password + name: {{ .Values.postgresql.fullnameOverride }} + key: postgres-password {{- end }} - name: DB_DATABASE + {{- if .Values.externalDatabase.existingSecret }} valueFrom: secretKeyRef: - {{- if .Values.externalDatabase.existingSecret }} name: {{ .Values.externalDatabase.existingSecret }} - key: {{ .Values.externalDatabase.existingSecretKeys.username }} - {{- else }} - name: pixelfed-database - key: database - {{- end }} + key: {{ .Values.externalDatabase.existingSecretKeys.database }} + {{- else }} + value: postgres + {{- end }} - name: DB_PORT + {{- if .Values.externalDatabase.existingSecret }} valueFrom: secretKeyRef: - {{- if .Values.externalDatabase.existingSecret }} name: {{ .Values.externalDatabase.existingSecret }} - key: {{ .Values.externalDatabase.existingSecretKeys.username }} - {{- else }} - name: pixelfed-database - key: port - {{- end }} + key: {{ .Values.externalDatabase.existingSecretKeys.port }} + {{- else }} + value: {{ .Values.postgresql.primary.service.ports.postgresql | quote }} + {{- end }} - name: DB_APPLY_NEW_MIGRATIONS_AUTOMATICALLY value: "{{ .Values.pixelfed.db_apply_new_migrations_automatically }}"