Skip to content

Commit

Permalink
Migrate tenant helm chart to use configuration file instead of credsS…
Browse files Browse the repository at this point in the history
…ecret (#1171)

Signed-off-by: Lenin Alevski <[email protected]>
  • Loading branch information
Alevsk authored Jun 16, 2022
1 parent 59887c2 commit b17cbf4
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 17 deletions.
11 changes: 11 additions & 0 deletions helm/tenant/templates/tenant-configuration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if dig "secrets" false (.Values | merge (dict)) }}
apiVersion: v1
kind: Secret
metadata:
name: {{ dig "secrets" "name" "" (.Values | merge (dict)) }}
type: Opaque
stringData:
config.env: |-
export MINIO_ROOT_USER={{ .Values.secrets.accessKey | quote }}
export MINIO_ROOT_PASSWORD={{ .Values.secrets.secretKey | quote }}
{{- end }}
10 changes: 10 additions & 0 deletions helm/tenant/templates/tenant-secret-deprecated.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Secret
metadata:
name: "tenant-secret"
type: Opaque
data:
## Access Key for MinIO Tenant
accesskey: ""
## Secret Key for MinIO Tenant
secretkey: ""
12 changes: 0 additions & 12 deletions helm/tenant/templates/tenant-secret.yaml

This file was deleted.

7 changes: 5 additions & 2 deletions helm/tenant/templates/tenant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ spec:
imagePullSecret:
name: {{ dig "imagePullSecret" "name" "" . }}
{{- end }}
{{- if dig "secrets" "enabled" false ($.Values | merge (dict)) }}
{{- if dig "secrets" false ($.Values | merge (dict)) }}
## Secret with credentials to be used by MinIO Tenant.
credsSecret:
configuration:
name: {{ dig "secrets" "name" "" ($.Values | merge (dict)) }}
## Deprecated credsSecret
credsSecret:
name: "tenant-secret"
{{- end }}
pools:
{{- range (dig "pools" (list) .) }}
Expand Down
5 changes: 2 additions & 3 deletions helm/tenant/values.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
## Secret with credentials to be used by MinIO Tenant
secrets:
# create a kubernetes secret object with the accessKey and secretKey as defined here.
enabled: true
name: minio1-secret
# create a kubernetes configuration secret object with the accessKey and secretKey as defined here.
name: minio1-env-configuration
accessKey: minio
secretKey: minio123

Expand Down

0 comments on commit b17cbf4

Please sign in to comment.