diff --git a/charts/mastodon/templates/cronjob-media-remove.yaml b/charts/mastodon/templates/cronjob-media-remove.yaml index d70afeb..57ec700 100644 --- a/charts/mastodon/templates/cronjob-media-remove.yaml +++ b/charts/mastodon/templates/cronjob-media-remove.yaml @@ -52,8 +52,10 @@ spec: envFrom: - configMapRef: name: {{ include "mastodon.fullname" . }}-env + {{- if not .Values.mastodon.secrets.existingSecret }} - secretRef: name: {{ template "mastodon.secretName" . }} + {{- end }} env: - name: "DB_PASS" valueFrom: @@ -68,16 +70,36 @@ spec: - name: "PORT" value: {{ .Values.mastodon.web.port | quote }} {{- if (and .Values.mastodon.s3.enabled .Values.mastodon.s3.existingSecret) }} - - name: "AWS_SECRET_ACCESS_KEY" + - name: "S3_HOSTNAME" valueFrom: secretKeyRef: name: {{ .Values.mastodon.s3.existingSecret }} - key: AWS_SECRET_ACCESS_KEY + key: {{ .Values.mastodon.s3.secretKeys.s3Hostname }} + - name: "S3_ENDPOINT" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.s3.existingSecret }} + key: {{ .Values.mastodon.s3.secretKeys.s3Endpoint }} + - name: "S3_REGION" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.s3.existingSecret }} + key: {{ .Values.mastodon.s3.secretKeys.s3Region }} + - name: "S3_BUCKET" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.s3.existingSecret }} + key: {{ .Values.mastodon.s3.secretKeys.s3Bucket }} - name: "AWS_ACCESS_KEY_ID" valueFrom: secretKeyRef: name: {{ .Values.mastodon.s3.existingSecret }} - key: AWS_ACCESS_KEY_ID + key: {{ .Values.mastodon.s3.secretKeys.s3AccessKeyID }} + - name: "AWS_SECRET_ACCESS_KEY" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.s3.existingSecret }} + key: {{ .Values.mastodon.s3.secretKeys.s3AccessKey }} {{- end }} {{- if (not .Values.mastodon.s3.enabled) }} volumeMounts: diff --git a/charts/mastodon/templates/deployment-sidekiq.yaml b/charts/mastodon/templates/deployment-sidekiq.yaml index 5dc9244..f591860 100644 --- a/charts/mastodon/templates/deployment-sidekiq.yaml +++ b/charts/mastodon/templates/deployment-sidekiq.yaml @@ -82,8 +82,10 @@ spec: envFrom: - configMapRef: name: {{ include "mastodon.fullname" $context }}-env + {{- if not .Values.mastodon.secrets.existingSecret }} - secretRef: - name: {{ template "mastodon.secretName" $context }} + name: {{ template "mastodon.secretName" . }} + {{- end }} env: - name: "DB_PASS" valueFrom: @@ -107,16 +109,36 @@ spec: name: {{ include "mastodon.smtp.secretName" $context }} key: password {{- if (and $context.Values.mastodon.s3.enabled $context.Values.mastodon.s3.existingSecret) }} - - name: "AWS_SECRET_ACCESS_KEY" + - name: "S3_HOSTNAME" valueFrom: secretKeyRef: - name: {{ $context.Values.mastodon.s3.existingSecret }} - key: AWS_SECRET_ACCESS_KEY + name: {{ .Values.mastodon.s3.existingSecret }} + key: {{ .Values.mastodon.s3.secretKeys.s3Hostname }} + - name: "S3_ENDPOINT" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.s3.existingSecret }} + key: {{ .Values.mastodon.s3.secretKeys.s3Endpoint }} + - name: "S3_REGION" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.s3.existingSecret }} + key: {{ .Values.mastodon.s3.secretKeys.s3Region }} + - name: "S3_BUCKET" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.s3.existingSecret }} + key: {{ .Values.mastodon.s3.secretKeys.s3Bucket }} - name: "AWS_ACCESS_KEY_ID" valueFrom: secretKeyRef: - name: {{ $context.Values.mastodon.s3.existingSecret }} - key: AWS_ACCESS_KEY_ID + name: {{ .Values.mastodon.s3.existingSecret }} + key: {{ .Values.mastodon.s3.secretKeys.s3AccessKeyID }} + - name: "AWS_SECRET_ACCESS_KEY" + valueFrom: + secretKeyRef: + name: {{ .Values.mastodon.s3.existingSecret }} + key: {{ .Values.mastodon.s3.secretKeys.s3AccessKey }} {{- end }} {{- if (not $context.Values.mastodon.s3.enabled) }} volumeMounts: diff --git a/charts/mastodon/templates/deployment-web.yaml b/charts/mastodon/templates/deployment-web.yaml index d04db8f..d3f56d2 100644 --- a/charts/mastodon/templates/deployment-web.yaml +++ b/charts/mastodon/templates/deployment-web.yaml @@ -63,9 +63,33 @@ spec: envFrom: - configMapRef: name: {{ include "mastodon.fullname" . }}-env + {{- if not .Values.mastodon.secrets.existingSecret }} - secretRef: 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-assets-precompile.yaml b/charts/mastodon/templates/job-assets-precompile.yaml index bc5ff7b..6dbe0d4 100644 --- a/charts/mastodon/templates/job-assets-precompile.yaml +++ b/charts/mastodon/templates/job-assets-precompile.yaml @@ -53,9 +53,33 @@ spec: envFrom: - configMapRef: name: {{ include "mastodon.fullname" . }}-env + {{- if not .Values.mastodon.secrets.existingSecret }} - secretRef: 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 f86a4e3..c388071 100644 --- a/charts/mastodon/templates/job-chewy-upgrade.yaml +++ b/charts/mastodon/templates/job-chewy-upgrade.yaml @@ -54,8 +54,10 @@ spec: envFrom: - configMapRef: name: {{ include "mastodon.fullname" . }}-env + {{- if not .Values.mastodon.secrets.existingSecret }} - secretRef: name: {{ template "mastodon.secretName" . }} + {{- end }} env: - name: "DB_PASS" valueFrom: diff --git a/charts/mastodon/templates/job-create-admin.yaml b/charts/mastodon/templates/job-create-admin.yaml index 12d0e1c..28ca82e 100644 --- a/charts/mastodon/templates/job-create-admin.yaml +++ b/charts/mastodon/templates/job-create-admin.yaml @@ -53,8 +53,10 @@ spec: envFrom: - configMapRef: name: {{ include "mastodon.fullname" . }}-env + {{- if not .Values.mastodon.secrets.existingSecret }} - secretRef: name: {{ template "mastodon.secretName" . }} + {{- end }} env: - name: "ADMIN_USER" {{- if .Values.mastodon.createAdmin.existingSecret }} diff --git a/charts/mastodon/templates/job-db-migrate.yaml b/charts/mastodon/templates/job-db-migrate.yaml index 8ea3a7e..6985331 100644 --- a/charts/mastodon/templates/job-db-migrate.yaml +++ b/charts/mastodon/templates/job-db-migrate.yaml @@ -52,9 +52,33 @@ spec: envFrom: - configMapRef: name: {{ include "mastodon.fullname" . }}-env + {{- if not .Values.mastodon.secrets.existingSecret }} - secretRef: 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: