From 7d946bd4b18aed842d2b3c8a897f785fdd108f41 Mon Sep 17 00:00:00 2001 From: holysoles Date: Fri, 17 Jan 2025 13:41:25 -0600 Subject: [PATCH 1/2] 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 }}" From 14a4cf6aad8c22856a109b6d4fb453c522f970f9 Mon Sep 17 00:00:00 2001 From: jessebot Date: Sat, 18 Jan 2025 10:44:51 +0100 Subject: [PATCH 2/2] bump helm chart version, regenerate docs --- charts/pixelfed/Chart.yaml | 2 +- charts/pixelfed/README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/pixelfed/Chart.yaml b/charts/pixelfed/Chart.yaml index 6f792ac..38ff7f7 100644 --- a/charts/pixelfed/Chart.yaml +++ b/charts/pixelfed/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.1 +version: 0.2.2 # This is the version number of the application being deployed. # renovate:image=ghcr.io/mattlqx/docker-pixelfed diff --git a/charts/pixelfed/README.md b/charts/pixelfed/README.md index 2e1bb3c..1ccbfc5 100644 --- a/charts/pixelfed/README.md +++ b/charts/pixelfed/README.md @@ -1,6 +1,6 @@ # pixelfed -![Version: 0.2.1](https://img.shields.io/badge/Version-0.2.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.12.3-nginx](https://img.shields.io/badge/AppVersion-v0.12.3--nginx-informational?style=flat-square) +![Version: 0.2.2](https://img.shields.io/badge/Version-0.2.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.12.3-nginx](https://img.shields.io/badge/AppVersion-v0.12.3--nginx-informational?style=flat-square) A Helm chart for deploying Pixelfed on Kubernetes @@ -190,4 +190,4 @@ A Helm chart for deploying Pixelfed on Kubernetes | volumes | list | `[]` | Additional volumes on the output Deployment definition. | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) +Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)