Skip to content

Commit

Permalink
refactor: use b64enc function when create secrets of s3 credentials a…
Browse files Browse the repository at this point in the history
…nd use range statement to create secret data
  • Loading branch information
zyy17 committed Jul 7, 2023
1 parent 2b3c453 commit 77411ca
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charts/greptimedb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: greptimedb
description: A Helm chart for deploying GreptimeDB cluster in Kubernetes
type: application
version: 0.1.1-alpha.11
version: 0.1.1-alpha.12
appVersion: 0.3.2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ metadata:
namespace: {{ .Release.Namespace }}
spec:
encryptedData:
{{- toYaml .Values.storage.s3.credentials.secretCreation.data | nindent 4 }}
{{- range $key, $value := .Values.storage.s3.credentials.secretCreation.data }}
{{ $key }}: {{ $value | quote }}
{{- end }}
template:
metadata:
name: {{ .Values.storage.s3.credentials.secretName }}
Expand Down
4 changes: 3 additions & 1 deletion charts/greptimedb/templates/s3-credentials-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ metadata:
kind: Secret
type: Opaque
data:
{{- toYaml .Values.storage.s3.credentials.secretCreation.data | nindent 4 }}
{{- range $key, $value := .Values.storage.s3.credentials.secretCreation.data }}
{{ $key }}: {{ $value | b64enc | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
15 changes: 10 additions & 5 deletions charts/greptimedb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,13 @@ storage:

# configure to use s3 storage.
s3: {}
# bucket: "greptimedb"
# bucket: "mycluster"
# region: "us-west-2"
# root: "/data"
# endpoint: ""
#
# # The root directory of the cluster.
# # The data directory in S3 will be: 's3://<bucket>/<root>/data/...'.
# root: "mycluster"
# endpoint: "s3.us-west-2.amazonaws.com"
# credentials:
# secretName: "s3-credentials"
# secretCreation:
Expand All @@ -86,6 +89,8 @@ storage:
# # Create the sealed secret.
# # If enableEncryption is true, the credentials should be encrypted.
# enableEncryption: false
#
# # If the enableEncryption is true, the data should be set as encrypted data.
# data:
# access-key-id: ""
# secret-access-key: ""
# access-key-id: "you-should-set-the-access-key-id-here"
# secret-access-key: "you-should-set-the-secret-access-key-here"

0 comments on commit 77411ca

Please sign in to comment.