Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use b64enc function when create secrets of s3 credentials and use range statement to create secret data #51

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"