From 3a3ae3b90e7cf3eddb7ee09b3997ea6257076ba0 Mon Sep 17 00:00:00 2001 From: liyang Date: Fri, 23 Aug 2024 19:40:27 +0800 Subject: [PATCH] feat: add gcs configuration (#162) * feat: add gcs configuration * feat: add gcs configuration --- charts/greptimedb-cluster/Chart.yaml | 2 +- charts/greptimedb-cluster/README.md | 4 ++-- charts/greptimedb-cluster/templates/cluster.yaml | 11 +++++++++++ charts/greptimedb-cluster/templates/secret.yaml | 5 +++++ charts/greptimedb-cluster/values.yaml | 10 ++++++++++ 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/charts/greptimedb-cluster/Chart.yaml b/charts/greptimedb-cluster/Chart.yaml index 89ee526..f587a6f 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.8 +version: 0.2.9 appVersion: 0.9.2 home: https://github.com/GreptimeTeam/greptimedb sources: diff --git a/charts/greptimedb-cluster/README.md b/charts/greptimedb-cluster/README.md index 6cba411..4cafda0 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.8](https://img.shields.io/badge/Version-0.2.8-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.9.2](https://img.shields.io/badge/AppVersion-0.9.2-informational?style=flat-square) +![Version: 0.2.9](https://img.shields.io/badge/Version-0.2.9-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.9.2](https://img.shields.io/badge/AppVersion-0.9.2-informational?style=flat-square) ## Source Code @@ -201,7 +201,7 @@ helm uninstall mycluster -n default | meta.replicas | int | `1` | Meta replicas | | meta.storeKeyPrefix | string | `""` | Meta will store data with this key prefix | | mysqlServicePort | int | `4002` | GreptimeDB mysql service port | -| objectStorage | object | `{"oss":{},"s3":{}}` | Configure to object storage | +| objectStorage | object | `{"gcs":{},"oss":{},"s3":{}}` | Configure to object storage | | postgresServicePort | int | `4003` | GreptimeDB postgres service port | | prometheusMonitor | object | `{"enabled":false,"interval":"30s","labels":{"release":"prometheus"}}` | Configure to prometheus PodMonitor | | prometheusMonitor.enabled | bool | `false` | Create PodMonitor resource for scraping metrics using PrometheusOperator | diff --git a/charts/greptimedb-cluster/templates/cluster.yaml b/charts/greptimedb-cluster/templates/cluster.yaml index bc3434b..dcbcdbe 100644 --- a/charts/greptimedb-cluster/templates/cluster.yaml +++ b/charts/greptimedb-cluster/templates/cluster.yaml @@ -341,6 +341,17 @@ spec: {{- end }} {{- end }} {{- end }} + {{- else if .Values.objectStorage.gcs }} + gcs: {{- toYaml .Values.objectStorage.gcs | nindent 6 }} + {{- if .Values.objectStorage }} + {{- if .Values.objectStorage.credentials }} + {{- if .Values.objectStorage.credentials.existingSecretName }} + secretName: {{ .Values.objectStorage.credentials.existingSecretName }} + {{- else }} + secretName: {{ default "storage-credentials" .Values.objectStorage.credentials.secretName }} + {{- end }} + {{- end }} + {{- end }} {{- else }} {} {{- end }} diff --git a/charts/greptimedb-cluster/templates/secret.yaml b/charts/greptimedb-cluster/templates/secret.yaml index a373609..d4626cb 100644 --- a/charts/greptimedb-cluster/templates/secret.yaml +++ b/charts/greptimedb-cluster/templates/secret.yaml @@ -7,9 +7,14 @@ metadata: namespace: {{ .Release.Namespace }} kind: Secret type: Opaque +{{- if .Values.objectStorage.credentials.serviceAccountKey }} +data: + service-account-key: {{ .Values.objectStorage.credentials.serviceAccountKey }} +{{- else }} stringData: access-key-id: {{ .Values.objectStorage.credentials.accessKeyId }} secret-access-key: {{ .Values.objectStorage.credentials.secretAccessKey }} {{- end }} {{- end }} {{- end }} +{{- end }} diff --git a/charts/greptimedb-cluster/values.yaml b/charts/greptimedb-cluster/values.yaml index 429e58b..f7d3eb3 100644 --- a/charts/greptimedb-cluster/values.yaml +++ b/charts/greptimedb-cluster/values.yaml @@ -414,6 +414,7 @@ objectStorage: # credentials: # accessKeyId: "you-should-set-the-access-key-id-here" # secretAccessKey: "you-should-set-the-secret-access-key-here" +# serviceAccountKey: "you-should-set-the-base64-service-account-key-here" # secretName: "" # existingSecretName: "" @@ -435,6 +436,15 @@ objectStorage: # root: "mycluster" # 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: "mycluster" + # endpoint: "https://storage.googleapis.com" + # -- Configure to remote wal remoteWal: # -- Enable remote wal