Fix broken dependencies in helm chart and allow using existing secrets in the chart (#18941)
* Add ability to specify an existing Secret (#18139) Closes #18139 * Allow using secrets with external postgres * Upgrade CronJob to batch/v1 * Allow using redis.auth.existingSecret * Helmignore mastodon-*.tgz for easy local development * Upgrade helm dependencies * Upgrade postgresql to 11 * Allow putting SMTP password into a secret * Add optional login to SMTP secret This to allow setting LOGIN either in values.yaml or in the secret. * Switch to bitnami charts full archive This prevents older versions from disappearing, see https://github.com/bitnami/charts/issues/10539 for full context. Co-authored-by: Ted Tramonte <ted.tramonte@gmail.com>
This commit is contained in:
@ -77,3 +77,53 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
|
||||
{{- define "mastodon.postgresql.fullname" -}}
|
||||
{{- printf "%s-%s" .Release.Name "postgresql" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Get the mastodon secret.
|
||||
*/}}
|
||||
{{- define "mastodon.secretName" -}}
|
||||
{{- if .Values.mastodon.secrets.existingSecret }}
|
||||
{{- printf "%s" (tpl .Values.mastodon.secrets.existingSecret $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s" (include "common.names.fullname" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Get the postgresql secret.
|
||||
*/}}
|
||||
{{- define "mastodon.postgresql.secretName" -}}
|
||||
{{- if (and (or .Values.postgresql.enabled .Values.postgresql.postgresqlHostname) .Values.postgresql.auth.existingSecret) }}
|
||||
{{- printf "%s" (tpl .Values.postgresql.auth.existingSecret $) -}}
|
||||
{{- else if .Values.postgresql.enabled -}}
|
||||
{{- printf "%s-postgresql" (tpl .Release.Name $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s" (include "common.names.fullname" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Get the redis secret.
|
||||
*/}}
|
||||
{{- define "mastodon.redis.secretName" -}}
|
||||
{{- if .Values.redis.auth.existingSecret }}
|
||||
{{- printf "%s" (tpl .Values.redis.auth.existingSecret $) -}}
|
||||
{{- else if .Values.redis.existingSecret }}
|
||||
{{- printf "%s" (tpl .Values.redis.existingSecret $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-redis" (tpl .Release.Name $) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if a mastodon secret object should be created
|
||||
*/}}
|
||||
{{- define "mastodon.createSecret" -}}
|
||||
{{- if (or
|
||||
(and .Values.mastodon.s3.enabled (not .Values.mastodon.s3.existingSecret))
|
||||
(not .Values.mastodon.secrets.existingSecret )
|
||||
(and (not .Values.postgresql.enabled) (not .Values.postgresql.auth.existingSecret))
|
||||
) -}}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
Reference in New Issue
Block a user