From 102d36e59eccb2bfb5a556caeef056ec5e72765c Mon Sep 17 00:00:00 2001 From: liyang Date: Mon, 26 Feb 2024 18:06:08 +0800 Subject: [PATCH] chore(greptimedb-cluster): use toYaml generate objectstorage configurations (#114) * chore(greptimedb-cluster): use toYaml generate objectstorage configurations * chore: refine objectstorage secretName value * chore: update docs * chore: use default secretName to simple configure objectstorage credentials --- charts/greptimedb-cluster/Chart.yaml | 2 +- charts/greptimedb-cluster/README.md | 2 +- .../greptimedb-cluster/templates/cluster.yaml | 24 +++++++++---------- .../greptimedb-cluster/templates/secret.yaml | 2 +- charts/greptimedb-cluster/values.yaml | 1 + 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/charts/greptimedb-cluster/Chart.yaml b/charts/greptimedb-cluster/Chart.yaml index 28beb83..cc97b8f 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.1.17 +version: 0.1.18 appVersion: 0.6.0 home: https://github.com/GreptimeTeam/greptimedb sources: diff --git a/charts/greptimedb-cluster/README.md b/charts/greptimedb-cluster/README.md index 7fdeb0a..6bdd3a2 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.1.17](https://img.shields.io/badge/Version-0.1.17-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.6.0](https://img.shields.io/badge/AppVersion-0.6.0-informational?style=flat-square) +![Version: 0.1.18](https://img.shields.io/badge/Version-0.1.18-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.6.0](https://img.shields.io/badge/AppVersion-0.6.0-informational?style=flat-square) ## Source Code diff --git a/charts/greptimedb-cluster/templates/cluster.yaml b/charts/greptimedb-cluster/templates/cluster.yaml index 38db9cf..b608ce4 100644 --- a/charts/greptimedb-cluster/templates/cluster.yaml +++ b/charts/greptimedb-cluster/templates/cluster.yaml @@ -216,19 +216,19 @@ spec: image: '{{ .Values.initializer.registry }}/{{ .Values.initializer.repository }}:{{ .Values.initializer.tag }}' objectStorage: {{- if .Values.objectStorage.s3 }} - s3: - bucket: {{ .Values.objectStorage.s3.bucket }} - region: {{ .Values.objectStorage.s3.region }} - root: {{ .Values.objectStorage.s3.root }} - secretName: {{ .Release.Name }}-secret - endpoint: {{ .Values.objectStorage.s3.endpoint }} + s3: {{- toYaml .Values.objectStorage.s3 | nindent 6 }} + {{- if .Values.objectStorage }} + {{- if .Values.objectStorage.credentials }} + secretName: {{ default "storage-credentials" .Values.objectStorage.credentials.secretName }} + {{- end }} + {{- end }} {{- else if .Values.objectStorage.oss }} - oss: - bucket: {{ .Values.objectStorage.oss.bucket }} - region: {{ .Values.objectStorage.oss.region }} - root: {{ .Values.objectStorage.oss.root }} - secretName: {{ .Release.Name }}-secret - endpoint: {{ .Values.objectStorage.oss.endpoint }} + oss: {{- toYaml .Values.objectStorage.oss | nindent 6 }} + {{- if .Values.objectStorage }} + {{- if .Values.objectStorage.credentials }} + secretName: {{ default "storage-credentials" .Values.objectStorage.credentials.secretName }} + {{- end }} + {{- end }} {{- else }} {} {{- end }} diff --git a/charts/greptimedb-cluster/templates/secret.yaml b/charts/greptimedb-cluster/templates/secret.yaml index 9e175fa..d1927f8 100644 --- a/charts/greptimedb-cluster/templates/secret.yaml +++ b/charts/greptimedb-cluster/templates/secret.yaml @@ -2,7 +2,7 @@ {{- if .Values.objectStorage.credentials }} apiVersion: v1 metadata: - name: {{ .Release.Name }}-secret + name: {{ default "storage-credentials" .Values.objectStorage.credentials.secretName }} namespace: {{ .Release.Namespace }} kind: Secret type: Opaque diff --git a/charts/greptimedb-cluster/values.yaml b/charts/greptimedb-cluster/values.yaml index 34c4ae6..fdf22c7 100644 --- a/charts/greptimedb-cluster/values.yaml +++ b/charts/greptimedb-cluster/values.yaml @@ -267,6 +267,7 @@ objectStorage: # credentials: # accessKeyId: "you-should-set-the-access-key-id-here" # secretAccessKey: "you-should-set-the-secret-access-key-here" +# secretName: "" # configure to use s3 storage. s3: {}