Browse Source
Allow user to define admin access and secret key via values
pull/8389/head
Richard Chen
1 day ago
Failed to extract signature
1 changed files with
10 additions and
3 deletions
-
k8s/charts/seaweedfs/templates/s3/s3-secret.yaml
|
|
|
@ -10,8 +10,15 @@ |
|
|
|
{{- if and .Values.s3.reuseLegacySecret $existingSecret }} |
|
|
|
{{- $reuse = true }} |
|
|
|
{{- end }} |
|
|
|
{{- $access_key_admin := include "getOrGeneratePassword" (dict "namespace" .Release.Namespace "secretName" $secretName "key" "admin_access_key_id" "length" 20 "existingSecret" (ternary $existingSecret nil $reuse)) -}} |
|
|
|
{{- $secret_key_admin := include "getOrGeneratePassword" (dict "namespace" .Release.Namespace "secretName" $secretName "key" "admin_secret_access_key" "length" 40 "existingSecret" (ternary $existingSecret nil $reuse)) -}} |
|
|
|
{{- $access_key_admin := "" -}} |
|
|
|
{{- $secret_key_admin := "" -}} |
|
|
|
{{- if and (dig "credentials" "admin" "accessKey" "" .Values.s3) (dig "credentials" "admin" "secretKey" "" .Values.s3) -}} |
|
|
|
{{- $access_key_admin = .Values.s3.credentials.admin.accessKey -}} |
|
|
|
{{- $secret_key_admin = .Values.s3.credentials.admin.secretKey -}} |
|
|
|
{{- else -}} |
|
|
|
{{- $access_key_admin = include "getOrGeneratePassword" (dict "namespace" .Release.Namespace "secretName" $secretName "key" "admin_access_key_id" "length" 20 "existingSecret" (ternary $existingSecret nil $reuse)) -}} |
|
|
|
{{- $secret_key_admin = include "getOrGeneratePassword" (dict "namespace" .Release.Namespace "secretName" $secretName "key" "admin_secret_access_key" "length" 40 "existingSecret" (ternary $existingSecret nil $reuse)) -}} |
|
|
|
{{- end -}} |
|
|
|
{{- $access_key_read := include "getOrGeneratePassword" (dict "namespace" .Release.Namespace "secretName" $secretName "key" "read_access_key_id" "length" 20 "existingSecret" (ternary $existingSecret nil $reuse)) -}} |
|
|
|
{{- $secret_key_read := include "getOrGeneratePassword" (dict "namespace" .Release.Namespace "secretName" $secretName "key" "read_secret_access_key" "length" 40 "existingSecret" (ternary $existingSecret nil $reuse)) -}} |
|
|
|
apiVersion: v1 |
|
|
|
@ -43,4 +50,4 @@ stringData: |
|
|
|
s3_auditLogConfig.json: | |
|
|
|
{{ toJson .Values.s3.auditLogConfig | nindent 4 }} |
|
|
|
{{- end }} |
|
|
|
{{- end }} |
|
|
|
{{- end }} |