From d82dd6e50cae354e26c367787492cda87b7b1481 Mon Sep 17 00:00:00 2001 From: zyy17 Date: Sun, 5 Nov 2023 01:49:37 +0800 Subject: [PATCH] chore: remove 'componentSpec' field and add 'config' and 'podTemplate' field --- charts/greptimedb-cluster/README.md | 9 ++++--- .../greptimedb-cluster/templates/cluster.yaml | 24 ++++++++++++----- charts/greptimedb-cluster/values.yaml | 27 ++++++++++++++----- 3 files changed, 45 insertions(+), 15 deletions(-) diff --git a/charts/greptimedb-cluster/README.md b/charts/greptimedb-cluster/README.md index afaaeea..ad16938 100644 --- a/charts/greptimedb-cluster/README.md +++ b/charts/greptimedb-cluster/README.md @@ -67,13 +67,15 @@ helm uninstall greptimedb-cluster -n default | Key | Type | Default | Description | |-----|------|---------|-------------| -| datanode.componentSpec | object | `{}` | Datanode componentSpec | +| datanode.config | string | `""` | Extra datanode config in toml format. | +| datanode.podTemplate | object | `{}` | The pod template for datanode. | | datanode.replicas | int | `3` | Datanode replicas | | datanode.storage.storageClassName | string | `nil` | Storage class for datanode persistent volume | | datanode.storage.storageRetainPolicy | string | `"Retain"` | Storage retain policy for datanode persistent volume | | datanode.storage.storageSize | string | `"10Gi"` | Storage size for datanode persistent volume | | datanode.storage.walDir | string | `"/tmp/greptimedb/wal"` | The wal directory of the storage, default is "/tmp/greptimedb/wal" | -| frontend.componentSpec | object | `{}` | Frontend componentSpec | +| frontend.config | string | `""` | Extra frontend config in toml format. | +| frontend.podTemplate | object | `{}` | The pod template for frontend. | | frontend.replicas | int | `1` | Frontend replicas | | frontend.service | object | `{}` | Frontend service | | frontend.tls | object | `{}` | Frontend tls configure | @@ -86,8 +88,9 @@ helm uninstall greptimedb-cluster -n default | initializer.registry | string | `"docker.io"` | Initializer image registry | | initializer.repository | string | `"greptime/greptimedb-initializer"` | Initializer image repository | | initializer.tag | string | `"0.1.0-alpha.17"` | Initializer image tag | -| meta.componentSpec | object | `{}` | Meta componentSpec | +| meta.config | string | `""` | Extra Meta config in toml format. | | meta.etcdEndpoints | string | `"etcd.default.svc.cluster.local:2379"` | Meta etcd endpoints | +| meta.podTemplate | object | `{}` | The pod template for Meta. | | meta.replicas | int | `1` | Meta replicas | | mysqlServicePort | int | `4002` | GreptimeDB mysql service port | | openTSDBServicePort | int | `4242` | GreptimeDB opentsdb service port | diff --git a/charts/greptimedb-cluster/templates/cluster.yaml b/charts/greptimedb-cluster/templates/cluster.yaml index aec9553..6ca2dc5 100644 --- a/charts/greptimedb-cluster/templates/cluster.yaml +++ b/charts/greptimedb-cluster/templates/cluster.yaml @@ -18,6 +18,10 @@ spec: {{- end }} frontend: replicas: {{ .Values.frontend.replicas }} + {{- if .Values.frontend.config }} + config: |- + {{ .Values.frontend.config | nindent 6 }} + {{- end }} {{- if .Values.frontend.tls }} tls: secretName: {{ .Values.frontend.tls.certificates.secretName }} @@ -25,22 +29,30 @@ spec: {{- if .Values.frontend.service }} service: {{- toYaml .Values.frontend.service | nindent 6 }} {{- end }} - {{- if .Values.frontend.componentSpec }} - template: {{- toYaml .Values.frontend.componentSpec | nindent 6 }} + {{- if .Values.frontend.podTemplate }} + template: {{- toYaml .Values.frontend.podTemplate | nindent 6 }} {{- end }} meta: replicas: {{ .Values.meta.replicas }} + {{- if .Values.meta.config }} + config: |- + {{ .Values.meta.config | nindent 6 }} + {{- end }} {{- if .Values.meta.etcdEndpoints }} etcdEndpoints: - {{ .Values.meta.etcdEndpoints }} {{- end }} - {{- if .Values.meta.componentSpec }} - template: {{- toYaml .Values.meta.componentSpec | nindent 6 }} + {{- if .Values.meta.podTemplate }} + template: {{- toYaml .Values.meta.podTemplate | nindent 6 }} {{- end }} datanode: replicas: {{ .Values.datanode.replicas }} - {{- if .Values.datanode.componentSpec }} - template: {{- toYaml .Values.datanode.componentSpec | nindent 6 }} + {{- if .Values.datanode.config }} + config: |- + {{ .Values.datanode.config | nindent 6 }} + {{- end }} + {{- if .Values.datanode.podTemplate }} + template: {{- toYaml .Values.datanode.podTemplate | nindent 6 }} {{- end }} storage: storageClassName: {{ .Values.datanode.storage.storageClassName }} diff --git a/charts/greptimedb-cluster/values.yaml b/charts/greptimedb-cluster/values.yaml index 5fc8b8f..59c0ebe 100644 --- a/charts/greptimedb-cluster/values.yaml +++ b/charts/greptimedb-cluster/values.yaml @@ -21,10 +21,15 @@ resources: frontend: # -- Frontend replicas replicas: 1 + + # -- Extra frontend config in toml format. + config: "" + + # -- The pod template for frontend. + podTemplate: {} + # -- Frontend service service: {} - # -- Frontend componentSpec - componentSpec: {} # -- Frontend tls configure tls: {} @@ -41,16 +46,26 @@ frontend: meta: # -- Meta replicas replicas: 1 + + # -- Extra Meta config in toml format. + config: "" + + # -- The pod template for Meta. + podTemplate: {} + # -- Meta etcd endpoints etcdEndpoints: "etcd.default.svc.cluster.local:2379" - # -- Meta componentSpec - componentSpec: {} datanode: # -- Datanode replicas replicas: 3 - # -- Datanode componentSpec - componentSpec: {} + + # -- Extra datanode config in toml format. + config: "" + + # -- The pod template for datanode. + podTemplate: {} + storage: # -- Storage class for datanode persistent volume storageClassName: null