diff --git a/charts/greptimedb-cluster/Chart.yaml b/charts/greptimedb-cluster/Chart.yaml index ddf9766..3591227 100644 --- a/charts/greptimedb-cluster/Chart.yaml +++ b/charts/greptimedb-cluster/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: greptimedb-cluster description: A Helm chart for deploying GreptimeDB cluster in Kubernetes. type: application -version: 0.2.22 +version: 0.2.23 appVersion: 0.9.5 home: https://github.com/GreptimeTeam/greptimedb sources: diff --git a/charts/greptimedb-cluster/README.md b/charts/greptimedb-cluster/README.md index 0dda521..96a4835 100644 --- a/charts/greptimedb-cluster/README.md +++ b/charts/greptimedb-cluster/README.md @@ -2,7 +2,7 @@ A Helm chart for deploying GreptimeDB cluster in Kubernetes. -![Version: 0.2.22](https://img.shields.io/badge/Version-0.2.22-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.9.5](https://img.shields.io/badge/AppVersion-0.9.5-informational?style=flat-square) +![Version: 0.2.23](https://img.shields.io/badge/Version-0.2.23-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.9.5](https://img.shields.io/badge/AppVersion-0.9.5-informational?style=flat-square) ## Source Code diff --git a/charts/greptimedb-cluster/values.yaml b/charts/greptimedb-cluster/values.yaml index b03046a..d1aabc2 100644 --- a/charts/greptimedb-cluster/values.yaml +++ b/charts/greptimedb-cluster/values.yaml @@ -602,10 +602,16 @@ prometheusMonitor: # -- Configure to object storage objectStorage: # credentials: +# secretName: "" + +# # AWS or AliCloud cloudProvider accessKeyID and secretAccessKey # accessKeyId: "you-should-set-the-access-key-id-here" # secretAccessKey: "you-should-set-the-secret-access-key-here" + +# # GCP cloudProvider serviceAccountKey JSON-formatted base64 value # serviceAccountKey: "you-should-set-the-base64-service-account-key-here" -# secretName: "" + +# # Set the existing secret to get the key's of cloudProvider # existingSecretName: "" # configure to use s3 storage. @@ -629,7 +635,7 @@ objectStorage: # configure to use gcs storage gcs: {} # bucket: "bucket-name" - # Scope: "" # example: "https://www.googleapis.com/auth/devstorage.read_write" + # scope: "" # example: "https://www.googleapis.com/auth/devstorage.read_write" # # The data directory in gcs will be: 'gcs:////data/...'. # root: "mycluster" diff --git a/charts/greptimedb-standalone/Chart.yaml b/charts/greptimedb-standalone/Chart.yaml index bdf0c42..2cca2fd 100644 --- a/charts/greptimedb-standalone/Chart.yaml +++ b/charts/greptimedb-standalone/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: greptimedb-standalone description: A Helm chart for deploying standalone greptimedb type: application -version: 0.1.24 +version: 0.1.25 appVersion: 0.9.5 home: https://github.com/GreptimeTeam/greptimedb sources: diff --git a/charts/greptimedb-standalone/README.md b/charts/greptimedb-standalone/README.md index 07e8b8a..25907f8 100644 --- a/charts/greptimedb-standalone/README.md +++ b/charts/greptimedb-standalone/README.md @@ -2,7 +2,7 @@ A Helm chart for deploying standalone greptimedb -![Version: 0.1.24](https://img.shields.io/badge/Version-0.1.24-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.9.5](https://img.shields.io/badge/AppVersion-0.9.5-informational?style=flat-square) +![Version: 0.1.25](https://img.shields.io/badge/Version-0.1.25-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.9.5](https://img.shields.io/badge/AppVersion-0.9.5-informational?style=flat-square) ## Source Code - https://github.com/GreptimeTeam/greptimedb @@ -72,7 +72,7 @@ helm uninstall greptimedb-standalone -n default | mysqlServicePort | int | `4002` | GreptimeDB mysql service port | | nameOverride | string | `""` | Overrides the chart's name | | nodeSelector | object | `{}` | NodeSelector to apply pod | -| objectStorage | object | `{"oss":{},"s3":{}}` | Configure to object storage | +| objectStorage | object | `{"gcs":{},"oss":{},"s3":{}}` | Configure to object storage | | persistence.enableStatefulSetAutoDeletePVC | bool | `false` | Enable StatefulSetAutoDeletePVC feature | | persistence.enabled | bool | `true` | Enable persistent disk | | persistence.mountPath | string | `"/data/greptimedb"` | Mount path of persistent disk. | diff --git a/charts/greptimedb-standalone/templates/_helpers.tpl b/charts/greptimedb-standalone/templates/_helpers.tpl index f2fe3a7..36ccd01 100644 --- a/charts/greptimedb-standalone/templates/_helpers.tpl +++ b/charts/greptimedb-standalone/templates/_helpers.tpl @@ -60,3 +60,48 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{- define "greptimedb-standalone.objectStorageConfig" -}} +{{- if or .Values.objectStorage.s3 .Values.objectStorage.oss .Values.objectStorage.gcs }} +{{- $provider := "" }} +{{- $bucket := "" }} +{{- $root := "" }} + +{{- if .Values.objectStorage.s3 }} + {{- $provider = "S3" }} + {{- $bucket = .Values.objectStorage.s3.bucket }} + {{- $root = .Values.objectStorage.s3.root }} +{{- else if .Values.objectStorage.oss }} + {{- $provider = "Oss" }} + {{- $bucket = .Values.objectStorage.oss.bucket }} + {{- $root = .Values.objectStorage.oss.root }} +{{- else if .Values.objectStorage.gcs }} + {{- $provider = "Gcs" }} + {{- $bucket = .Values.objectStorage.gcs.bucket }} + {{- $root = .Values.objectStorage.gcs.root }} +{{- end }} + +{{- if and $provider $bucket }} +[storage] + # Storage provider type: S3, Oss, or Gcs + type = "{{ $provider }}" + + # Bucket name in the storage provider + bucket = "{{ $bucket }}" + + # Root path within the bucket + root = "{{ $root }}" + +{{- if .Values.objectStorage.s3 }} + endpoint = "{{ .Values.objectStorage.s3.endpoint }}" + region = "{{ .Values.objectStorage.s3.region }}" +{{- else if .Values.objectStorage.oss }} + endpoint = "{{ .Values.objectStorage.oss.endpoint }}" + region = "{{ .Values.objectStorage.oss.region }}" +{{- else if .Values.objectStorage.gcs }} + endpoint = "{{ .Values.objectStorage.gcs.endpoint }}" + scope = "{{ .Values.objectStorage.gcs.scope }}" +{{- end }} +{{- end }} +{{- end }} +{{- end }} diff --git a/charts/greptimedb-standalone/templates/configmap.yaml b/charts/greptimedb-standalone/templates/configmap.yaml index 42606bf..4998741 100644 --- a/charts/greptimedb-standalone/templates/configmap.yaml +++ b/charts/greptimedb-standalone/templates/configmap.yaml @@ -9,4 +9,5 @@ metadata: data: config.toml: | {{ .Values.configToml | indent 4 }} +{{ include "greptimedb-standalone.objectStorageConfig" . | indent 4 }} {{- end -}} diff --git a/charts/greptimedb-standalone/templates/secret.yaml b/charts/greptimedb-standalone/templates/secret.yaml index 81bfd72..9050d89 100644 --- a/charts/greptimedb-standalone/templates/secret.yaml +++ b/charts/greptimedb-standalone/templates/secret.yaml @@ -1,28 +1,25 @@ {{- if .Values.objectStorage }} {{- if .Values.objectStorage.credentials }} +{{- if not .Values.objectStorage.credentials.existingSecretName }} apiVersion: v1 metadata: name: {{ .Release.Name }}-secret namespace: {{ .Release.Namespace }} kind: Secret type: Opaque +{{- if .Values.objectStorage.credentials.serviceAccountKey }} +data: + GREPTIMEDB_STANDALONE__STORAGE__CREDENTIAL: {{ .Values.objectStorage.credentials.serviceAccountKey | b64enc }} +{{- else }} stringData: {{- if .Values.objectStorage.s3}} - GREPTIMEDB_STANDALONE__STORAGE__TYPE: "S3" GREPTIMEDB_STANDALONE__STORAGE__ACCESS_KEY_ID: {{ .Values.objectStorage.credentials.accessKeyId }} GREPTIMEDB_STANDALONE__STORAGE__SECRET_ACCESS_KEY: {{ .Values.objectStorage.credentials.secretAccessKey }} - GREPTIMEDB_STANDALONE__STORAGE__BUCKET: {{ .Values.objectStorage.s3.bucket}} - GREPTIMEDB_STANDALONE__STORAGE__ROOT: {{ .Values.objectStorage.s3.root }} - GREPTIMEDB_STANDALONE__STORAGE__REGION: {{ .Values.objectStorage.s3.region }} - GREPTIMEDB_STANDALONE__STORAGE__ENDPOINT: {{ .Values.objectStorage.s3.endpoint }} {{ else if .Values.objectStorage.oss }} - GREPTIMEDB_STANDALONE__STORAGE__TYPE: "Oss" GREPTIMEDB_STANDALONE__STORAGE__ACCESS_KEY_ID: {{ .Values.objectStorage.credentials.accessKeyId }} - GREPTIMEDB_STANDALONE__STORAGE__ACCESS_KEY_SECRET: {{ .Values.objectStorage.credentials.secretAccessKey }} - GREPTIMEDB_STANDALONE__STORAGE__BUCKET: {{ .Values.objectStorage.oss.bucket}} - GREPTIMEDB_STANDALONE__STORAGE__ROOT: {{ .Values.objectStorage.oss.root }} - GREPTIMEDB_STANDALONE__STORAGE__REGION: {{ .Values.objectStorage.oss.region }} - GREPTIMEDB_STANDALONE__STORAGE__ENDPOINT: {{ .Values.objectStorage.oss.endpoint }} - {{- end}} + GREPTIMEDB_STANDALONE__STORAGE__ACCESS_KEY_SECRET: {{ .Values.objectStorage.credentials.accessKeySecret }} +{{- end }} +{{- end }} +{{- end }} {{- end }} {{- end }} diff --git a/charts/greptimedb-standalone/templates/statefulset.yaml b/charts/greptimedb-standalone/templates/statefulset.yaml index efc8ee1..f16695a 100644 --- a/charts/greptimedb-standalone/templates/statefulset.yaml +++ b/charts/greptimedb-standalone/templates/statefulset.yaml @@ -97,7 +97,11 @@ spec: {{- if .Values.objectStorage.credentials }} envFrom: - secretRef: + {{- if .Values.objectStorage.credentials.existingSecretName }} + name: {{ .Values.objectStorage.credentials.existingSecretName }} + {{- else }} name: {{ .Release.Name }}-secret + {{- end }} {{- end }} {{- end }} {{- with .Values.securityContext }} diff --git a/charts/greptimedb-standalone/values.yaml b/charts/greptimedb-standalone/values.yaml index 42247cf..48487bd 100644 --- a/charts/greptimedb-standalone/values.yaml +++ b/charts/greptimedb-standalone/values.yaml @@ -41,9 +41,21 @@ dataHome: "/data/greptimedb/" # -- Configure to object storage objectStorage: -# credentials: -# accessKeyId: "you-should-set-the-access-key-id-here" -# secretAccessKey: "you-should-set-the-secret-access-key-here" + # credentials: + # # AWS or AliCloud cloudProvider accessKeyID + # accessKeyId: "you-should-set-the-access-key-id-here" + + # # AWS cloudProvider secretAccessKey + # secretAccessKey: "you-should-set-the-secret-access-key-here" + + # # AliCloud cloudProvider secretAccessKey + # accessKeySecret: "you-should-set-the-access-key-secret-here" + + # # GCP cloudProvider serviceAccountKey JSON-formatted base64 value + # serviceAccountKey: "you-should-set-the-base64-service-account-key-here" + + # # Set the existing secret to get the key's of cloudProvider + # existingSecretName: "" # configure to use s3 storage s3: {} @@ -63,6 +75,15 @@ objectStorage: # root: "greptimedb-standalone" # endpoint: "oss-cn-hangzhou.aliyuncs.com" + # configure to use gcs storage + gcs: {} + # bucket: "bucket-name" + # scope: "" # example: "https://www.googleapis.com/auth/devstorage.read_write" + + # # The data directory in gcs will be: 'gcs:////data/...'. + # root: "greptimedb-standalone" + # endpoint: "https://storage.googleapis.com" + # -- Environment variables env: GREPTIMEDB_STANDALONE__HTTP__ADDR: "0.0.0.0:4000"