Skip to content

Commit

Permalink
refactor: add oss storage configure
Browse files Browse the repository at this point in the history
  • Loading branch information
daviderli614 committed Oct 10, 2023
1 parent 99719ed commit e0b7340
Show file tree
Hide file tree
Showing 8 changed files with 9,370 additions and 9,331 deletions.
18,571 changes: 9,295 additions & 9,276 deletions charts/greptimedb-operator/crds/greptimedbcluster.yaml

Large diffs are not rendered by default.

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.13
version: 0.1.1-alpha.14
appVersion: 0.3.2
9 changes: 8 additions & 1 deletion charts/greptimedb/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,18 @@ spec:
bucket: {{ .Values.storage.s3.bucket }}
region: {{ .Values.storage.s3.region }}
root: {{ .Values.storage.s3.root }}
secretName: {{ .Values.storage.s3.credentials.secretName }}
secretName: {{ .Values.storage.s3.secretName }}
endpoint: {{ .Values.storage.s3.endpoint }}
{{- else if .Values.storage.local }}
local:
directory: {{ .Values.storage.local.directory }}
{{- else if .Values.storage.oss }}
oss:
bucket: {{ .Values.storage.oss.bucket }}
region: {{ .Values.storage.oss.region }}
root: {{ .Values.storage.oss.root }}
secretName: {{ .Values.storage.oss.secretName }}
endpoint: {{ .Values.storage.oss.endpoint }}
{{- else }}
{}
{{- end }}
20 changes: 20 additions & 0 deletions charts/greptimedb/templates/credentials-sealed-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if .Values.storage.credentials }}
{{- if .Values.storage.credentials.secretCreation }}
{{- if and (eq .Values.storage.credentials.secretCreation.enabled true) (eq .Values.storage.credentials.secretCreation.enableEncryption true) }}
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
name: {{ .Values.storage.credentials.secretName }}
namespace: {{ .Release.Namespace }}
spec:
encryptedData:
{{- range $key, $value := .Values.storage.credentials.secretCreation.data }}
{{ $key }}: {{ $value | quote }}
{{- end }}
template:
metadata:
name: {{ .Values.storage.credentials.secretName }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end }}
{{- end }}
16 changes: 16 additions & 0 deletions charts/greptimedb/templates/credentials-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.storage.credentials }}
{{- if .Values.storage.credentials.secretCreation }}
{{- if and (eq .Values.storage.credentials.secretCreation.enabled true) (eq .Values.storage.credentials.secretCreation.enableEncryption false) }}
apiVersion: v1
metadata:
name: {{ .Values.storage.credentials.secretName }}
namespace: {{ .Release.Namespace }}
kind: Secret
type: Opaque
data:
{{- range $key, $value := .Values.storage.credentials.secretCreation.data }}
{{ $key }}: {{ $value | b64enc | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
20 changes: 0 additions & 20 deletions charts/greptimedb/templates/s3-credentials-sealed-secret.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions charts/greptimedb/templates/s3-credentials-secret.yaml

This file was deleted.

47 changes: 30 additions & 17 deletions charts/greptimedb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ datanode:
initializer:
registry: docker.io
repository: greptime/greptimedb-initializer
tag: 0.1.0-alpha.14
tag: 0.1.0-alpha.16

# The etcdEndpoints need be modified to the actual etcd cluster.
etcdEndpoints: "etcd.default.svc.cluster.local:2379"
Expand All @@ -68,29 +68,42 @@ prometheusMonitor: {}
# release: prometheus

storage:
# credentials:
# secretName: "credentials"
# secretCreation:
# # Create the raw secret.
# enabled: true
# # 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: "you-should-set-the-access-key-id-here"
# secret-access-key: "you-should-set-the-secret-access-key-here"

# configure to use local storage.
local: {}
# directory: /tmp/greptimedb

# configure to use s3 storage.
s3: {}
# bucket: "mycluster"
s3:
# bucket: "bucket-name"
# region: "us-west-2"
#

# # 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:
# # Create the raw secret.
# enabled: true
# # 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: "you-should-set-the-access-key-id-here"
# secret-access-key: "you-should-set-the-secret-access-key-here"
# secretName: "credentials"

# configure to use oss storage.
oss: {}
# bucket: "bucket-name"
# region: "cn-hangzhou"

# # The root directory of the cluster.
# # The data directory in OSS will be: 'oss://<bucket>/<root>/data/...'.
# root: "mycluster"
# endpoint: "oss-cn-hangzhou.aliyuncs.com"
# secretName: "credentials"

0 comments on commit e0b7340

Please sign in to comment.