From 423f380f07c5b1edc6409fd47911e63f4c83c0c8 Mon Sep 17 00:00:00 2001 From: jessebot Date: Fri, 14 Jul 2023 11:06:48 +0200 Subject: [PATCH] adding mastodon secret blocks; todo: move to _helpers.tpl later --- .../templates/cronjob-media-remove.yaml | 22 +++++++++++++++++++ .../templates/deployment-sidekiq.yaml | 22 +++++++++++++++++++ .../mastodon/templates/job-chewy-upgrade.yaml | 22 +++++++++++++++++++ .../mastodon/templates/job-create-admin.yaml | 22 +++++++++++++++++++ 4 files changed, 88 insertions(+) diff --git a/charts/mastodon/templates/cronjob-media-remove.yaml b/charts/mastodon/templates/cronjob-media-remove.yaml index 57ec700..f9d0060 100644 --- a/charts/mastodon/templates/cronjob-media-remove.yaml +++ b/charts/mastodon/templates/cronjob-media-remove.yaml @@ -57,6 +57,28 @@ spec: name: {{ template "mastodon.secretName" . }} {{- end }} env: + {{- if .Values.mastodon.secrets.existingSecret }} + - name: "SECRET_KEY_BASE" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.secrets.existingSecret }} + key: {{ .Values.mastodon.secrets.secretKeys.secretKeyBase }} + - name: "OTP_SECRET" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.secrets.existingSecret }} + key: {{ .Values.mastodon.secrets.secretKeys.optSecret }} + - name: "VAPID_PRIVATE_KEY" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.secrets.existingSecret }} + key: {{ .Values.mastodon.secrets.secretKeys.vapidPrivateKey }} + - name: "VAPID_PUBLIC_KEY" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.secrets.existingSecret }} + key: {{ .Values.mastodon.secrets.secretKeys.vapidPublicKey }} + {{- end }} - name: "DB_PASS" valueFrom: secretKeyRef: diff --git a/charts/mastodon/templates/deployment-sidekiq.yaml b/charts/mastodon/templates/deployment-sidekiq.yaml index f591860..7815428 100644 --- a/charts/mastodon/templates/deployment-sidekiq.yaml +++ b/charts/mastodon/templates/deployment-sidekiq.yaml @@ -87,6 +87,28 @@ spec: name: {{ template "mastodon.secretName" . }} {{- end }} env: + {{- if .Values.mastodon.secrets.existingSecret }} + - name: "SECRET_KEY_BASE" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.secrets.existingSecret }} + key: {{ .Values.mastodon.secrets.secretKeys.secretKeyBase }} + - name: "OTP_SECRET" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.secrets.existingSecret }} + key: {{ .Values.mastodon.secrets.secretKeys.optSecret }} + - name: "VAPID_PRIVATE_KEY" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.secrets.existingSecret }} + key: {{ .Values.mastodon.secrets.secretKeys.vapidPrivateKey }} + - name: "VAPID_PUBLIC_KEY" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.secrets.existingSecret }} + key: {{ .Values.mastodon.secrets.secretKeys.vapidPublicKey }} + {{- end }} - name: "DB_PASS" valueFrom: secretKeyRef: diff --git a/charts/mastodon/templates/job-chewy-upgrade.yaml b/charts/mastodon/templates/job-chewy-upgrade.yaml index c388071..a3f3e19 100644 --- a/charts/mastodon/templates/job-chewy-upgrade.yaml +++ b/charts/mastodon/templates/job-chewy-upgrade.yaml @@ -59,6 +59,28 @@ spec: name: {{ template "mastodon.secretName" . }} {{- end }} env: + {{- if .Values.mastodon.secrets.existingSecret }} + - name: "SECRET_KEY_BASE" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.secrets.existingSecret }} + key: {{ .Values.mastodon.secrets.secretKeys.secretKeyBase }} + - name: "OTP_SECRET" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.secrets.existingSecret }} + key: {{ .Values.mastodon.secrets.secretKeys.optSecret }} + - name: "VAPID_PRIVATE_KEY" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.secrets.existingSecret }} + key: {{ .Values.mastodon.secrets.secretKeys.vapidPrivateKey }} + - name: "VAPID_PUBLIC_KEY" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.secrets.existingSecret }} + key: {{ .Values.mastodon.secrets.secretKeys.vapidPublicKey }} + {{- end }} - name: "DB_PASS" valueFrom: secretKeyRef: diff --git a/charts/mastodon/templates/job-create-admin.yaml b/charts/mastodon/templates/job-create-admin.yaml index 28ca82e..a3e5238 100644 --- a/charts/mastodon/templates/job-create-admin.yaml +++ b/charts/mastodon/templates/job-create-admin.yaml @@ -58,6 +58,28 @@ spec: name: {{ template "mastodon.secretName" . }} {{- end }} env: + {{- if .Values.mastodon.secrets.existingSecret }} + - name: "SECRET_KEY_BASE" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.secrets.existingSecret }} + key: {{ .Values.mastodon.secrets.secretKeys.secretKeyBase }} + - name: "OTP_SECRET" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.secrets.existingSecret }} + key: {{ .Values.mastodon.secrets.secretKeys.optSecret }} + - name: "VAPID_PRIVATE_KEY" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.secrets.existingSecret }} + key: {{ .Values.mastodon.secrets.secretKeys.vapidPrivateKey }} + - name: "VAPID_PUBLIC_KEY" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.secrets.existingSecret }} + key: {{ .Values.mastodon.secrets.secretKeys.vapidPublicKey }} + {{- end }} - name: "ADMIN_USER" {{- if .Values.mastodon.createAdmin.existingSecret }} valueFrom: