Skip to content

Commit

Permalink
Allow existing secret (#2299)
Browse files Browse the repository at this point in the history
allow existing secret (#2298)
  • Loading branch information
ramondeklein authored Aug 29, 2024
1 parent 63461a1 commit 44217fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions helm/tenant/templates/tenant-configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{{- if not (.Values.tenant.configSecret) }}
{{- fail "# ERROR: '.tenant.configSecret' should be set." }}
{{- else }}
{{- if not (.Values.tenant.configSecret.existingSecret) }}

apiVersion: v1
kind: Secret
Expand All @@ -15,6 +16,14 @@ stringData:
export MINIO_ROOT_USER={{ .Values.tenant.configSecret.accessKey | quote }}
export MINIO_ROOT_PASSWORD={{ .Values.tenant.configSecret.secretKey | quote }}
{{- else }}
{{- if (.Values.tenant.configSecret.accessKey) }}
{{- fail "# ERROR: cannot set access-key when an existing secret is used" }}
{{- end }}
{{- if (.Values.tenant.configSecret.secretKey) }}
{{- fail "# ERROR: cannot set secret-key when an existing secret is used" }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

2 changes: 2 additions & 0 deletions helm/tenant/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ tenant:
name: myminio-env-configuration
accessKey: minio
secretKey: minio123
#existingSecret: true

###
# If this variable is set to true, then enable the usage of an existing Kubernetes secret to set environment variables for the Tenant.
# The existing Kubernetes secret name must be placed under .tenant.configuration.name e.g. existing-minio-env-configuration
Expand Down

0 comments on commit 44217fb

Please sign in to comment.