diff --git a/charts/greptimedb-cluster/README.md b/charts/greptimedb-cluster/README.md index 582c093..8b16298 100644 --- a/charts/greptimedb-cluster/README.md +++ b/charts/greptimedb-cluster/README.md @@ -65,14 +65,42 @@ helm uninstall mycluster -n default | Key | Type | Default | Description | |-----|------|---------|-------------| | datanode.config | string | `""` | Extra datanode config in toml format. | -| datanode.podTemplate | object | `{}` | The pod template for datanode. | +| datanode.podTemplate | object | `{"affinity":{},"annotations":{},"labels":{},"main":{"args":[],"command":[],"env":[],"image":"","resources":{"limits":{},"requests":{}}},"nodeSelector":{},"serviceaccount":{"annotations":{},"create":false,"name":"datanode-sa"},"tolerations":[]}` | The pod template for datanode | +| datanode.podTemplate.affinity | object | `{}` | The pod affinity | +| datanode.podTemplate.annotations | object | `{}` | The annotations to be created to the pod. | +| datanode.podTemplate.labels | object | `{}` | The labels to be created to the pod. | +| datanode.podTemplate.main | object | `{"args":[],"command":[],"env":[],"image":"","resources":{"limits":{},"requests":{}}}` | The spec of main container | +| datanode.podTemplate.main.args | list | `[]` | The arguments to be passed to the command | +| datanode.podTemplate.main.command | list | `[]` | The command to be executed in the container | +| datanode.podTemplate.main.env | list | `[]` | The environment variables for the container | +| datanode.podTemplate.main.image | string | `""` | The datanode image. | +| datanode.podTemplate.main.resources.limits | object | `{}` | The resources limits for the container | +| datanode.podTemplate.main.resources.requests | object | `{}` | The requested resources for the container | +| datanode.podTemplate.nodeSelector | object | `{}` | The pod node selector | +| datanode.podTemplate.serviceaccount.annotations | object | `{}` | The annotations for datanode serviceaccount | +| datanode.podTemplate.serviceaccount.create | bool | `false` | Create a service account | +| datanode.podTemplate.serviceaccount.name | string | `"datanode-sa"` | The serviceaccount name | +| datanode.podTemplate.tolerations | list | `[]` | The pod tolerations | | 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.config | string | `""` | Extra frontend config in toml format. | -| frontend.podTemplate | object | `{}` | The pod template for frontend. | +| frontend.podTemplate | object | `{"affinity":{},"annotations":{},"labels":{},"main":{"args":[],"command":[],"env":[],"image":"","resources":{"limits":{},"requests":{}}},"nodeSelector":{},"serviceAccountName":"","tolerations":[]}` | The pod template for datanode | +| frontend.podTemplate.affinity | object | `{}` | The pod affinity | +| frontend.podTemplate.annotations | object | `{}` | The annotations to be created to the pod. | +| frontend.podTemplate.labels | object | `{}` | The labels to be created to the pod. | +| frontend.podTemplate.main | object | `{"args":[],"command":[],"env":[],"image":"","resources":{"limits":{},"requests":{}}}` | The spec of main container | +| frontend.podTemplate.main.args | list | `[]` | The arguments to be passed to the command | +| frontend.podTemplate.main.command | list | `[]` | The command to be executed in the container | +| frontend.podTemplate.main.env | list | `[]` | The environment variables for the container | +| frontend.podTemplate.main.image | string | `""` | The datanode image. | +| frontend.podTemplate.main.resources.limits | object | `{}` | The resources limits for the container | +| frontend.podTemplate.main.resources.requests | object | `{}` | The requested resources for the container | +| frontend.podTemplate.nodeSelector | object | `{}` | The pod node selector | +| frontend.podTemplate.serviceAccountName | string | `""` | The service account for frontend | +| frontend.podTemplate.tolerations | list | `[]` | The pod tolerations | | frontend.replicas | int | `1` | Frontend replicas | | frontend.service | object | `{}` | Frontend service | | frontend.tls | object | `{}` | Frontend tls configure | @@ -87,7 +115,20 @@ helm uninstall mycluster -n default | initializer.tag | string | `"0.1.0-alpha.17"` | Initializer image tag | | 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.podTemplate | object | `{"affinity":{},"annotations":{},"labels":{},"main":{"args":[],"command":[],"env":[],"image":"","resources":{"limits":{},"requests":{}}},"nodeSelector":{},"serviceAccountName":"","tolerations":[]}` | The pod template for datanode | +| meta.podTemplate.affinity | object | `{}` | The pod affinity | +| meta.podTemplate.annotations | object | `{}` | The annotations to be created to the pod. | +| meta.podTemplate.labels | object | `{}` | The labels to be created to the pod. | +| meta.podTemplate.main | object | `{"args":[],"command":[],"env":[],"image":"","resources":{"limits":{},"requests":{}}}` | The spec of main container | +| meta.podTemplate.main.args | list | `[]` | The arguments to be passed to the command | +| meta.podTemplate.main.command | list | `[]` | The command to be executed in the container | +| meta.podTemplate.main.env | list | `[]` | The environment variables for the container | +| meta.podTemplate.main.image | string | `""` | The datanode image. | +| meta.podTemplate.main.resources.limits | object | `{}` | The resources limits for the container | +| meta.podTemplate.main.resources.requests | object | `{}` | The requested resources for the container | +| meta.podTemplate.nodeSelector | object | `{}` | The pod node selector | +| meta.podTemplate.serviceAccountName | string | `""` | The service account for meta | +| meta.podTemplate.tolerations | list | `[]` | The pod tolerations | | meta.replicas | int | `1` | Meta replicas | | mysqlServicePort | int | `4002` | GreptimeDB mysql service port | | openTSDBServicePort | int | `4242` | GreptimeDB opentsdb service port | @@ -95,7 +136,4 @@ helm uninstall mycluster -n default | prometheusMonitor | object | `{}` | Configure to prometheus podmonitor | | resources.limits | object | `{"cpu":"500m","memory":"512Mi"}` | The resources limits for the container | | resources.requests | object | `{"cpu":"500m","memory":"512Mi"}` | The requested resources for the container | -| serviceAccount.annotations | object | `{}` | The annotations for serviceaccount | -| serviceAccount.create | bool | `true` | Create a service account | -| serviceAccount.name | string | `"greptimedb-cluster"` | The serviceaccount name | | storage | object | `{"local":{},"oss":{},"s3":{}}` | Configure to storage | diff --git a/charts/greptimedb-cluster/templates/cluster.yaml b/charts/greptimedb-cluster/templates/cluster.yaml index c46e2a2..8c25e8e 100644 --- a/charts/greptimedb-cluster/templates/cluster.yaml +++ b/charts/greptimedb-cluster/templates/cluster.yaml @@ -16,9 +16,6 @@ spec: - name: {{ . }} {{- end }} {{- end }} - {{- if .Values.serviceAccount.create }} - serviceAccountName: {{ .Values.serviceAccount.name }} - {{- end }} frontend: replicas: {{ .Values.frontend.replicas }} {{- if .Values.frontend.config }} @@ -32,9 +29,41 @@ spec: {{- if .Values.frontend.service }} service: {{- toYaml .Values.frontend.service | nindent 6 }} {{- end }} - {{- if .Values.frontend.podTemplate }} - template: {{- toYaml .Values.frontend.podTemplate | nindent 6 }} - {{- end }} + template: + main: + {{- if .Values.frontend.podTemplate.main.image }} + image: {{ .Values.frontend.podTemplate.main.image }} + {{- end }} + {{- if .Values.frontend.podTemplate.main.command }} + command: {{ .Values.frontend.podTemplate.main.command }} + {{- end }} + {{- if .Values.frontend.podTemplate.main.args }} + args: {{ .Values.frontend.podTemplate.main.args }} + {{- end }} + {{- if .Values.frontend.podTemplate.main.env }} + env: {{- toYaml .Values.frontend.podTemplate.main.env | nindent 8 }} + {{- end }} + resources: + requests: {{ .Values.frontend.podTemplate.main.resources.requests | toYaml | nindent 12 }} + limits: {{ .Values.frontend.podTemplate.main.resources.limits | toYaml | nindent 12 }} + {{- if .Values.frontend.podTemplate.annotations }} + annotations: {{ .Values.frontend.podTemplate.annotations | toYaml | nindent 8 }} + {{- end }} + {{- if .Values.frontend.podTemplate.labels }} + labels: {{ .Values.frontend.podTemplate.labels | toYaml | nindent 8 }} + {{- end }} + {{- if .Values.frontend.podTemplate.serviceAccountName }} + serviceAccountName: {{ .Values.frontend.podTemplate.serviceAccountName }} + {{- end }} + {{- if .Values.frontend.podTemplate.tolerations }} + tolerations: {{ .Values.frontend.podTemplate.tolerations | toYaml | nindent 8 }} + {{- end }} + {{- if .Values.frontend.podTemplate.affinity }} + affinity: {{ .Values.frontend.podTemplate.affinity | toYaml | nindent 8 }} + {{- end }} + {{- if .Values.frontend.podTemplate.nodeSelector }} + nodeSelector: {{ .Values.frontend.podTemplate.nodeSelector | toYaml | nindent 8 }} + {{- end }} meta: replicas: {{ .Values.meta.replicas }} {{- if .Values.meta.config }} @@ -45,18 +74,82 @@ spec: etcdEndpoints: - {{ .Values.meta.etcdEndpoints }} {{- end }} - {{- if .Values.meta.podTemplate }} - template: {{- toYaml .Values.meta.podTemplate | nindent 6 }} - {{- end }} + template: + main: + {{- if .Values.meta.podTemplate.main.image }} + image: {{ .Values.meta.podTemplate.main.image }} + {{- end }} + {{- if .Values.meta.podTemplate.main.command }} + command: {{ .Values.meta.podTemplate.main.command }} + {{- end }} + {{- if .Values.meta.podTemplate.main.args }} + args: {{ .Values.meta.podTemplate.main.args }} + {{- end }} + {{- if .Values.meta.podTemplate.main.env }} + env: {{- toYaml .Values.meta.podTemplate.main.env | nindent 8 }} + {{- end }} + resources: + requests: {{ .Values.meta.podTemplate.main.resources.requests | toYaml | nindent 12 }} + limits: {{ .Values.meta.podTemplate.main.resources.limits | toYaml | nindent 12 }} + {{- if .Values.meta.podTemplate.annotations }} + annotations: {{ .Values.meta.podTemplate.annotations | toYaml | nindent 8 }} + {{- end }} + {{- if .Values.meta.podTemplate.labels }} + labels: {{ .Values.meta.podTemplate.labels | toYaml | nindent 8 }} + {{- end }} + {{- if .Values.meta.podTemplate.serviceAccountName }} + serviceAccountName: {{ .Values.meta.podTemplate.serviceAccountName }} + {{- end }} + {{- if .Values.meta.podTemplate.tolerations }} + tolerations: {{ .Values.meta.podTemplate.tolerations | toYaml | nindent 8 }} + {{- end }} + {{- if .Values.meta.podTemplate.affinity }} + affinity: {{ .Values.meta.podTemplate.affinity | toYaml | nindent 8 }} + {{- end }} + {{- if .Values.meta.podTemplate.nodeSelector }} + nodeSelector: {{ .Values.meta.podTemplate.nodeSelector | toYaml | nindent 8 }} + {{- end }} datanode: replicas: {{ .Values.datanode.replicas }} {{- if .Values.datanode.config }} config: |- {{ .Values.datanode.config | nindent 6 }} {{- end }} - {{- if .Values.datanode.podTemplate }} - template: {{- toYaml .Values.datanode.podTemplate | nindent 6 }} - {{- end }} + template: + main: + {{- if .Values.datanode.podTemplate.main.image }} + image: {{ .Values.datanode.podTemplate.main.image }} + {{- end }} + {{- if .Values.datanode.podTemplate.main.command }} + command: {{ .Values.datanode.podTemplate.main.command }} + {{- end }} + {{- if .Values.datanode.podTemplate.main.args }} + args: {{ .Values.datanode.podTemplate.main.args }} + {{- end }} + {{- if .Values.datanode.podTemplate.main.env }} + env: {{- toYaml .Values.datanode.podTemplate.main.env | nindent 8 }} + {{- end }} + resources: + requests: {{ .Values.datanode.podTemplate.main.resources.requests | toYaml | nindent 12 }} + limits: {{ .Values.datanode.podTemplate.main.resources.limits | toYaml | nindent 12 }} + {{- if .Values.datanode.podTemplate.annotations }} + annotations: {{ .Values.datanode.podTemplate.annotations | toYaml | nindent 8 }} + {{- end }} + {{- if .Values.datanode.podTemplate.labels }} + labels: {{ .Values.datanode.podTemplate.labels | toYaml | nindent 8 }} + {{- end }} + {{- if .Values.datanode.podTemplate.serviceaccount.create }} + serviceAccountName: {{ .Values.datanode.podTemplate.serviceaccount.name }} + {{- end }} + {{- if .Values.datanode.podTemplate.tolerations }} + tolerations: {{ .Values.datanode.podTemplate.tolerations | toYaml | nindent 8 }} + {{- end }} + {{- if .Values.datanode.podTemplate.affinity }} + affinity: {{ .Values.datanode.podTemplate.affinity | toYaml | nindent 8 }} + {{- end }} + {{- if .Values.datanode.podTemplate.nodeSelector }} + nodeSelector: {{ .Values.datanode.podTemplate.nodeSelector | toYaml | nindent 8 }} + {{- end }} storage: storageClassName: {{ .Values.datanode.storage.storageClassName }} storageSize: {{ .Values.datanode.storage.storageSize }} diff --git a/charts/greptimedb-cluster/templates/datanode-serviceaccount.yaml b/charts/greptimedb-cluster/templates/datanode-serviceaccount.yaml new file mode 100644 index 0000000..fd67483 --- /dev/null +++ b/charts/greptimedb-cluster/templates/datanode-serviceaccount.yaml @@ -0,0 +1,11 @@ +{{- if .Values.datanode.podTemplate.serviceaccount.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Values.datanode.podTemplate.serviceaccount.name }} + namespace: {{ .Release.Namespace }} + {{- with .Values.datanode.podTemplate.serviceaccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/greptimedb-cluster/templates/serviceaccount.yaml b/charts/greptimedb-cluster/templates/serviceaccount.yaml deleted file mode 100644 index f1832b9..0000000 --- a/charts/greptimedb-cluster/templates/serviceaccount.yaml +++ /dev/null @@ -1,11 +0,0 @@ -{{- if .Values.serviceAccount.create }} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ .Values.serviceAccount.name }} - namespace: {{ .Release.Namespace }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/charts/greptimedb-cluster/values.yaml b/charts/greptimedb-cluster/values.yaml index 89c1da7..57fcd86 100644 --- a/charts/greptimedb-cluster/values.yaml +++ b/charts/greptimedb-cluster/values.yaml @@ -18,14 +18,6 @@ resources: cpu: 500m memory: 512Mi -serviceAccount: - # -- Create a service account - create: true - # -- The serviceaccount name - name: greptimedb-cluster - # -- The annotations for serviceaccount - annotations: {} - frontend: # -- Frontend replicas replicas: 1 @@ -33,8 +25,44 @@ frontend: # -- Extra frontend config in toml format. config: "" - # -- The pod template for frontend. - podTemplate: {} + # -- The pod template for datanode + podTemplate: + # -- The spec of main container + main: + # -- The datanode image. + image: "" + + resources: + # -- The requested resources for the container + requests: {} + # cpu: "1" + # memory: "2Gi" + # -- The resources limits for the container + limits: {} + # cpu: "1" + # memory: "2Gi" + + # -- The environment variables for the container + env: [] + + # -- The command to be executed in the container + command: [] + + # -- The arguments to be passed to the command + args: [] + + # -- The annotations to be created to the pod. + annotations: {} + # -- The labels to be created to the pod. + labels: {} + # -- The pod node selector + nodeSelector: {} + # -- The pod tolerations + tolerations: [] + # -- The pod affinity + affinity: {} + # -- The service account for frontend + serviceAccountName: "" # -- Frontend service service: {} @@ -50,8 +78,44 @@ meta: # -- Extra Meta config in toml format. config: "" - # -- The pod template for Meta. - podTemplate: {} + # -- The pod template for datanode + podTemplate: + # -- The spec of main container + main: + # -- The datanode image. + image: "" + + resources: + # -- The requested resources for the container + requests: {} + # cpu: "1" + # memory: "2Gi" + # -- The resources limits for the container + limits: {} + # cpu: "1" + # memory: "2Gi" + + # -- The environment variables for the container + env: [] + + # -- The command to be executed in the container + command: [] + + # -- The arguments to be passed to the command + args: [] + + # -- The annotations to be created to the pod. + annotations: {} + # -- The labels to be created to the pod. + labels: {} + # -- The pod node selector + nodeSelector: {} + # -- The pod tolerations + tolerations: [] + # -- The pod affinity + affinity: {} + # -- The service account for meta + serviceAccountName: "" # -- Meta etcd endpoints etcdEndpoints: "etcd.default.svc.cluster.local:2379" @@ -63,8 +127,49 @@ datanode: # -- Extra datanode config in toml format. config: "" - # -- The pod template for datanode. - podTemplate: {} + # -- The pod template for datanode + podTemplate: + # -- The spec of main container + main: + # -- The datanode image. + image: "" + + resources: + # -- The requested resources for the container + requests: {} + # cpu: "1" + # memory: "2Gi" + # -- The resources limits for the container + limits: {} + # cpu: "1" + # memory: "2Gi" + + # -- The environment variables for the container + env: [] + + # -- The command to be executed in the container + command: [] + + # -- The arguments to be passed to the command + args: [] + + # -- The annotations to be created to the pod. + annotations: {} + # -- The labels to be created to the pod. + labels: {} + # -- The pod node selector + nodeSelector: {} + # -- The pod tolerations + tolerations: [] + # -- The pod affinity + affinity: {} + serviceaccount: + # -- Create a service account + create: false + # -- The serviceaccount name + name: datanode-sa + # -- The annotations for datanode serviceaccount + annotations: {} storage: # -- Storage class for datanode persistent volume