diff --git a/charts/starrocks/.helmignore b/charts/starrocks/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/starrocks/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/starrocks/Chart.yaml b/charts/starrocks/Chart.yaml new file mode 100644 index 0000000..260f51f --- /dev/null +++ b/charts/starrocks/Chart.yaml @@ -0,0 +1,23 @@ +apiVersion: v2 +appVersion: 3.5-latest +description: A Helm chart for StarRocks cluster +home: https://github.com/StarRocks/starrocks-kubernetes-operator +icon: https://avatars.githubusercontent.com/u/88238841 +keywords: +- operator +- starrocks +- database +- olap +kubeVersion: '>=1.23.0-0' +maintainers: +- email: caixiaohua@starrocks.com + name: Kevin Cai +- email: shensida@starrocks.com + name: SidaShen +- email: yandongxiao@starrocks.com + name: Dongxiao Yan +name: starrocks +sources: +- https://github.com/StarRocks/starrocks +type: application +version: 1.11.0 diff --git a/charts/starrocks/README.md b/charts/starrocks/README.md new file mode 100644 index 0000000..2abc1d0 --- /dev/null +++ b/charts/starrocks/README.md @@ -0,0 +1,39 @@ +# Deploy StarRocks Cluster by starrocks Chart + +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Release Charts](https://img.shields.io/badge/Release-helmcharts-green.svg)](https://github.com/StarRocks/starrocks-kubernetes-operator/releases) + +[Helm](https://helm.sh/) is a package manager for Kubernetes. A [Helm Chart](https://helm.sh/docs/topics/charts/) is a Helm package and contains all of the resource definitions necessary to run an application on a Kubernetes cluster. This topic describes how to use Helm to automatically deploy a StarRocks cluster on a Kubernetes cluster. + +## Before you begin + +- [Create a Kubernetes cluster](https://kubernetes.io/). +- [Install Helm](https://helm.sh/docs/intro/quickstart/). +- [Install StarRocks operator](../operator/README.md#install-operator-chart). + +## Install starrocks Chart + +1. Add the StarRocks Helm repository. + + ```bash + $ helm repo add starrocks https://starrocks.github.io/starrocks-kubernetes-operator + $ helm repo update starrocks + $ helm search repo starrocks + NAME CHART VERSION APP VERSION DESCRIPTION + starrocks/kube-starrocks 1.8.0 3.1-latest kube-starrocks includes two subcharts, starrock... + starrocks/operator 1.8.0 1.8.0 A Helm chart for StarRocks operator + starrocks/starrocks 1.8.0 3.1-latest A Helm chart for StarRocks cluster + ``` + +2. Install the starrocks Chart. + + ```bash + helm install starrocks starrocks/starrocks + ``` + + Please see [values.yaml](./values.yaml) for more details. + +## Uninstall starrocks Chart + +```bash +helm uninstall starrocks +``` diff --git a/charts/starrocks/templates/NOTES.txt b/charts/starrocks/templates/NOTES.txt new file mode 100644 index 0000000..ff57486 --- /dev/null +++ b/charts/starrocks/templates/NOTES.txt @@ -0,0 +1,9 @@ +{{- if .Values.metrics.serviceMonitor.enabled }} +{{- if not (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") }} +ERROR: Installation of the ServiceMonitor CR for the Prometheus operator failed. Please ensure it is installed beforehand. +{{- end }} +{{- end }} + +Thank you for installing {{ .Chart.Name }}-{{ .Chart.Version }} starrocks chart. Please wait for a few minutes for the cluster to be ready. + +Please see the values.yaml for more operation information: https://github.com/StarRocks/starrocks-kubernetes-operator/blob/main/helm-charts/charts/kube-starrocks/charts/starrocks/values.yaml diff --git a/charts/starrocks/templates/_helpers.tpl b/charts/starrocks/templates/_helpers.tpl new file mode 100644 index 0000000..b152d32 --- /dev/null +++ b/charts/starrocks/templates/_helpers.tpl @@ -0,0 +1,743 @@ +{{/* +Common labels +*/}} +{{- define "starrockscluster.labels" -}} +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +initpassword secret name +*/}} + +{{- define "starrockscluster.initpassword.secret.name" -}} +{{ default (print (include "starrockscluster.name" .) "-credential") .Values.initPassword.passwordSecret }} +{{- end }} + +{{/* +starrockscluster +*/}} + +{{- define "starrockscluster.name" -}} +{{ default (default .Chart.Name .Values.nameOverride) .Values.starrocksCluster.name }} +{{- end }} + +{{- define "starrockscluster.namespace" -}} +{{ default .Release.Namespace .Values.starrocksCluster.namespace }} +{{- end }} + +{{- define "starrockscluster.fe.name" -}} +{{- print (include "starrockscluster.name" .) "-fe" }} +{{- end }} + +{{- define "starrockscluster.cn.name" -}} +{{- print (include "starrockscluster.name" .) "-cn" }} +{{- end }} + +{{- define "starrockscluster.be.name" -}} +{{- print (include "starrockscluster.name" .) "-be" }} +{{- end }} + +{{- define "starrockscluster.be.configmap.name" -}} +{{- print (include "starrockscluster.be.name" .) "-cm" }} +{{- end }} + +{{- define "starrockscluster.fe.configmap.name" -}} +{{- print (include "starrockscluster.fe.name" .) "-cm" }} +{{- end }} + +{{- define "starrockscluster.cn.configmap.name" -}} +{{- print (include "starrockscluster.cn.name" .) "-cm" }} +{{- end }} + +{{- define "starrockscluster.fe.config" -}} +fe.conf: | +{{- if and .Values.starrocksFESpec.configyaml (kindIs "map" .Values.starrocksFESpec.configyaml) }} + {{- range $key, $value := .Values.starrocksFESpec.configyaml }} + {{ $key }} = {{ $value }} + {{- end }} +{{- else if .Values.starrocksFESpec.configyaml }} + {{ fail "configyaml must be a map" }} +{{- else }} + {{- .Values.starrocksFESpec.config | nindent 2 }} +{{- end }} +{{- end }} + +{{- define "starrockscluster.cn.config" -}} +cn.conf: | +{{- if and .Values.starrocksCnSpec.configyaml (kindIs "map" .Values.starrocksCnSpec.configyaml) }} + {{- range $key, $value := .Values.starrocksCnSpec.configyaml }} + {{ $key }} = {{ $value }} + {{- end }} +{{- else if .Values.starrocksCnSpec.configyaml }} + {{ fail "configyaml must be a map" }} +{{- else }} + {{- .Values.starrocksCnSpec.config | nindent 2 }} +{{- end }} +{{- end }} + +{{- define "starrockscluster.be.config" -}} +be.conf: | +{{- if and .Values.starrocksBeSpec.configyaml (kindIs "map" .Values.starrocksBeSpec.configyaml) }} + {{- range $key, $value := .Values.starrocksBeSpec.configyaml }} + {{ $key }} = {{ $value }} + {{- end }} +{{- else if .Values.starrocksBeSpec.configyaml }} + {{ fail "configyaml must be a map" }} +{{- else }} + {{- .Values.starrocksBeSpec.config | nindent 2 }} +{{- end }} +{{- end }} + +{{- define "starrockscluster.fe.meta.suffix" -}} +{{- print "-meta" }} +{{- end }} + +{{- define "starrockscluster.fe.meta.path" -}} +{{- if .Values.starrocksFESpec.storageSpec.storageMountPath }} +{{- print .Values.starrocksFESpec.storageSpec.storageMountPath }} +{{- else }} +{{- print "/opt/starrocks/fe/meta" }} +{{- end }} +{{- end }} + +{{- define "starrockscluster.fe.log.suffix" -}} +{{- print "-log" }} +{{- end }} + +{{- define "starrockscluster.fe.log.path" -}} +{{- if .Values.starrocksFESpec.storageSpec.logMountPath }} +{{- print .Values.starrocksFESpec.storageSpec.logMountPath }} +{{- else }} +{{- print "/opt/starrocks/fe/log" }} +{{- end }} +{{- end }} + +{{- define "starrockscluster.be.data.suffix" -}} +{{- print "-data" }} +{{- end }} + +{{- define "starrockscluster.be.data.path" -}} +{{- if .Values.starrocksBeSpec.storageSpec.storageMountPath }} +{{- print .Values.starrocksBeSpec.storageSpec.storageMountPath }} +{{- else }} +{{- print "/opt/starrocks/be/storage" }} +{{- end }} +{{- end }} + +{{- define "starrockscluster.be.log.suffix" -}} +{{- print "-log" }} +{{- end }} + +{{- define "starrockscluster.be.log.path" -}} +{{- if .Values.starrocksBeSpec.storageSpec.logMountPath }} +{{- print .Values.starrocksBeSpec.storageSpec.logMountPath }} +{{- else }} +{{- print "/opt/starrocks/be/log" }} +{{- end }} +{{- end }} + +{{- define "starrockscluster.be.spill.suffix" -}} +{{- print "-spill" }} +{{- end }} + +{{- define "starrockscluster.be.spill.path" -}} +{{- if .Values.starrocksBeSpec.storageSpec.spillMountPath }} +{{- print .Values.starrocksBeSpec.storageSpec.spillMountPath }} +{{- else }} +{{- print "/opt/starrocks/be/spill" }} +{{- end }} +{{- end }} + +{{- define "starrockscluster.cn.data.suffix" -}} +{{- print "-data" }} +{{- end }} + +{{- define "starrockscluster.cn.data.path" -}} +{{- if .Values.starrocksCnSpec.storageSpec.storageMountPath }} +{{- print .Values.starrocksCnSpec.storageSpec.storageMountPath }} +{{- else }} +{{- print "/opt/starrocks/cn/storage" }} +{{- end }} +{{- end }} + +{{- define "starrockscluster.cn.log.suffix" -}} +{{- print "-log" }} +{{- end }} + +{{- define "starrockscluster.cn.log.path" -}} +{{- if .Values.starrocksCnSpec.storageSpec.logMountPath }} +{{- print .Values.starrocksCnSpec.storageSpec.logMountPath }} +{{- else }} +{{- print "/opt/starrocks/cn/log" }} +{{- end }} +{{- end }} + +{{- define "starrockscluster.cn.spill.suffix" -}} +{{- print "-spill" }} +{{- end }} + +{{- define "starrockscluster.cn.spill.path" -}} +{{- if .Values.starrocksCnSpec.storageSpec.spillMountPath }} +{{- print .Values.starrocksCnSpec.storageSpec.spillMountPath }} +{{- else }} +{{- print "/opt/starrocks/cn/spill" }} +{{- end }} +{{- end }} + +{{- define "starrockscluster.entrypoint.script.name" -}} +{{- print "entrypoint.sh" }} +{{- end }} + +{{- define "starrockscluster.entrypoint.mount.path" -}} +{{- print "/etc/starrocks" }} +{{- end }} + +{{- define "starrockscluster.fe.entrypoint.script.configmap.name" -}} +{{- print (include "starrockscluster.name" .) "-fe-entrypoint-script" }} +{{- end }} + +{{- define "starrockscluster.be.entrypoint.script.configmap.name" -}} +{{- print (include "starrockscluster.name" .) "-be-entrypoint-script" }} +{{- end }} + +{{- define "starrockscluster.cn.entrypoint.script.configmap.name" -}} +{{- print (include "starrockscluster.name" .) "-cn-entrypoint-script" }} +{{- end }} + +{{/* +Define a function to handle resource limits for fe +*/}} +{{- define "starrockscluster.fe.resources" -}} +requests: + {{- toYaml .Values.starrocksFESpec.resources.requests | nindent 2 }} +limits: +{{- range $key, $value := .Values.starrocksFESpec.resources.limits }} + {{- if ne (toString $value) "unlimited" }} + {{ $key }}: {{ $value }} + {{- end }} +{{- end }} +{{- end -}} + +{{/* +Define a function to handle resource limits for be +*/}} +{{- define "starrockscluster.be.resources" -}} +requests: + {{- toYaml .Values.starrocksBeSpec.resources.requests | nindent 2 }} +limits: +{{- range $key, $value := .Values.starrocksBeSpec.resources.limits }} + {{- if ne (toString $value) "unlimited" }} + {{ $key }}: {{ $value }} + {{- end }} +{{- end }} +{{- end -}} + +{{/* +Define a function to handle resource limits for cn +*/}} +{{- define "starrockscluster.cn.resources" -}} +requests: + {{- toYaml .Values.starrocksCnSpec.resources.requests | nindent 2 }} +limits: +{{- range $key, $value := .Values.starrocksCnSpec.resources.limits }} + {{- if ne (toString $value) "unlimited" }} + {{ $key }}: {{ $value }} + {{- end }} +{{- end }} +{{- end -}} + +{{/* +starrockscluster.fe.config.hash is used to calculate the hash value of the fe.conf, and due to the length limit, only +the first 8 digits are taken, which will be used as the annotations for pods. +*/}} +{{- define "starrockscluster.fe.config.hash" }} + {{- if and .Values.starrocksFESpec.configyaml (kindIs "map" .Values.starrocksFESpec.configyaml) }} + {{- $hash := toJson .Values.starrocksFESpec.configyaml | sha256sum | trunc 8 }} + {{- printf "%s" $hash }} + {{- else if .Values.starrocksFESpec.configyaml }} + {{ fail "configyaml must be a map" }} + {{- else if .Values.starrocksFESpec.config }} + {{- $hash := toJson .Values.starrocksFESpec.config | sha256sum | trunc 8 }} + {{- printf "%s" $hash }} + {{- else }} + {{- printf "no-config" }} + {{- end }} +{{- end }} + + +{{/* +starrockscluster.be.config.hash is used to calculate the hash value of the be.conf, and due to the length limit, only +the first 8 digits are taken, which will be used as the annotations for pods. +*/}} +{{- define "starrockscluster.be.config.hash" }} + {{- if and .Values.starrocksBeSpec.configyaml (kindIs "map" .Values.starrocksBeSpec.configyaml) }} + {{- $hash := toJson .Values.starrocksBeSpec.configyaml | sha256sum | trunc 8 }} + {{- printf "%s" $hash }} + {{- else if .Values.starrocksBeSpec.configyaml }} + {{ fail "configyaml must be a map" }} + {{- else if .Values.starrocksBeSpec.config }} + {{- $hash := toJson .Values.starrocksBeSpec.config | sha256sum | trunc 8 }} + {{- printf "%s" $hash }} + {{- else }} + {{- printf "no-config" }} + {{- end }} +{{- end }} + +{{/* +starrockscluster.cn.config.hash is used to calculate the hash value of the cn.conf, and due to the length limit, only +the first 8 digits are taken, which will be used as the annotations for pods. +*/}} +{{- define "starrockscluster.cn.config.hash" }} + {{- if and .Values.starrocksCnSpec.configyaml (kindIs "map" .Values.starrocksCnSpec.configyaml) }} + {{- $hash := toJson .Values.starrocksCnSpec.configyaml | sha256sum | trunc 8 }} + {{- printf "%s" $hash }} + {{- else if .Values.starrocksCnSpec.configyaml }} + {{ fail "configyaml must be a map" }} + {{- else if .Values.starrocksCnSpec.config }} + {{- $hash := toJson .Values.starrocksCnSpec.config | sha256sum | trunc 8 }} + {{- printf "%s" $hash }} + {{- else }} + {{- printf "no-config" }} + {{- end }} +{{- end }} + +{{- define "starrockscluster.fe.query.port" -}} +{{- $config := index .Values.starrocksFESpec.config -}} +{{- $configMap := dict -}} +{{- range $line := splitList "\n" $config -}} +{{- $pair := splitList "=" $line -}} +{{- if eq (len $pair) 2 -}} +{{- $_ := set $configMap (trim (index $pair 0)) (trim (index $pair 1)) -}} +{{- end -}} +{{- end -}} +{{- if (index $configMap "query_port") -}} +{{- print (index $configMap "query_port") }} +{{- end }} +{{- end }} + +{{- define "starrockscluster.fe.entrypoint.script.hash" }} + {{- if .Values.starrocksFESpec.entrypoint }} + {{- $hash := toJson .Values.starrocksFESpec.entrypoint.script | sha256sum | trunc 8 }} + {{- printf "%s" $hash }} + {{- else }} + {{- printf "no-config" }} + {{- end }} +{{- end }} + +{{- define "starrockscluster.be.entrypoint.script.hash" }} + {{- if .Values.starrocksBeSpec.entrypoint }} + {{- $hash := toJson .Values.starrocksBeSpec.entrypoint.script | sha256sum | trunc 8 }} + {{- printf "%s" $hash }} + {{- else }} + {{- printf "no-config" }} + {{- end }} +{{- end }} + +{{- define "starrockscluster.cn.entrypoint.script.hash" }} + {{- if .Values.starrocksCnSpec.entrypoint }} + {{- $hash := toJson .Values.starrocksCnSpec.entrypoint.script | sha256sum | trunc 8 }} + {{- printf "%s" $hash }} + {{- else }} + {{- printf "no-config" }} + {{- end }} +{{- end }} + +{{- define "starrockscluster.fe.http.port" -}} +{{- $config := index .Values.starrocksFESpec.config -}} +{{- $configMap := dict -}} +{{- range $line := splitList "\n" $config -}} +{{- $pair := splitList "=" $line -}} +{{- if eq (len $pair) 2 -}} +{{- $_ := set $configMap (trim (index $pair 0)) (trim (index $pair 1)) -}} +{{- end -}} +{{- end -}} +{{- if (index $configMap "http_port") -}} +{{- print (index $configMap "http_port") }} +{{- end }} +{{- end }} + +{{- define "starrockscluster.be.webserver.port" -}} +{{- include "starrockscluster.webserver.port" .Values.starrocksBeSpec }} +{{- end }} + +{{- define "starrockscluster.cn.webserver.port" -}} +{{- include "starrockscluster.webserver.port" .Values.starrocksCnSpec }} +{{- end }} + +{{- define "starrockscluster.webserver.port" -}} +{{- $config := index .config -}} +{{- $configMap := dict -}} +{{- range $line := splitList "\n" $config -}} +{{- $pair := splitList "=" $line -}} +{{- if eq (len $pair) 2 -}} +{{- $_ := set $configMap (trim (index $pair 0)) (trim (index $pair 1)) -}} +{{- end -}} +{{- end -}} +{{- if (index $configMap "webserver_port") -}} +{{- print (index $configMap "webserver_port") }} +{{- end }} +{{- end }} + +{{/* +Get the value of the schedulerName field in the starrocksFESpec +*/}} +{{- define "starrockscluster.fe.schedulerName" -}} +{{- if .Values.starrocksFESpec.schedulerName -}} +{{- .Values.starrocksFESpec.schedulerName -}} +{{- else if .Values.starrocksCluster.componentValues.schedulerName -}} +{{- .Values.starrocksCluster.componentValues.schedulerName -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the schedulerName field in the starrocksBeSpec +*/}} +{{- define "starrockscluster.be.schedulerName" -}} +{{- if .Values.starrocksBeSpec.schedulerName -}} +{{- .Values.starrocksBeSpec.schedulerName -}} +{{- else if .Values.starrocksCluster.componentValues.schedulerName -}} +{{- .Values.starrocksCluster.componentValues.schedulerName -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the schedulerName field in the starrocksCnSpec +*/}} +{{- define "starrockscluster.cn.schedulerName" -}} +{{- if .Values.starrocksCnSpec.schedulerName -}} +{{- .Values.starrocksCnSpec.schedulerName -}} +{{- else if .Values.starrocksCluster.componentValues.schedulerName -}} +{{- .Values.starrocksCluster.componentValues.schedulerName -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the serviceAccount field in the starrocksFESpec +*/}} +{{- define "starrockscluster.fe.serviceAccount" -}} +{{- if .Values.starrocksFESpec.serviceAccount -}} +{{- .Values.starrocksFESpec.serviceAccount -}} +{{- else if .Values.starrocksCluster.componentValues.serviceAccount -}} +{{- .Values.starrocksCluster.componentValues.serviceAccount -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the serviceAccount field in the starrocksBeSpec +*/}} +{{- define "starrockscluster.be.serviceAccount" -}} +{{- if .Values.starrocksBeSpec.serviceAccount -}} +{{- .Values.starrocksBeSpec.serviceAccount -}} +{{- else if .Values.starrocksCluster.componentValues.serviceAccount -}} +{{- .Values.starrocksCluster.componentValues.serviceAccount -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the serviceAccount field in the starrocksCnSpec +*/}} +{{- define "starrockscluster.cn.serviceAccount" -}} +{{- if .Values.starrocksCnSpec.serviceAccount -}} +{{- .Values.starrocksCnSpec.serviceAccount -}} +{{- else if .Values.starrocksCluster.componentValues.serviceAccount -}} +{{- .Values.starrocksCluster.componentValues.serviceAccount -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the imagePullSecrets field in the starrocksFESpec +*/}} +{{- define "starrockscluster.fe.imagePullSecrets" -}} +{{- if .Values.starrocksFESpec.imagePullSecrets -}} +{{- toYaml .Values.starrocksFESpec.imagePullSecrets -}} +{{- else if .Values.starrocksCluster.componentValues.imagePullSecrets -}} +{{- toYaml .Values.starrocksCluster.componentValues.imagePullSecrets -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the imagePullSecrets field in the starrocksBeSpec +*/}} +{{- define "starrockscluster.be.imagePullSecrets" -}} +{{- if .Values.starrocksBeSpec.imagePullSecrets -}} +{{- toYaml .Values.starrocksBeSpec.imagePullSecrets -}} +{{- else if .Values.starrocksCluster.componentValues.imagePullSecrets -}} +{{- toYaml .Values.starrocksCluster.componentValues.imagePullSecrets -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the imagePullSecrets field in the starrocksCnSpec +*/}} +{{- define "starrockscluster.cn.imagePullSecrets" -}} +{{- if .Values.starrocksCnSpec.imagePullSecrets -}} +{{- toYaml .Values.starrocksCnSpec.imagePullSecrets -}} +{{- else if .Values.starrocksCluster.componentValues.imagePullSecrets -}} +{{- toYaml .Values.starrocksCluster.componentValues.imagePullSecrets -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the tolerations field in the starrocksFESpec +*/}} +{{- define "starrockscluster.fe.tolerations" -}} +{{- if .Values.starrocksFESpec.tolerations -}} +{{- toYaml .Values.starrocksFESpec.tolerations -}} +{{- else if .Values.starrocksCluster.componentValues.tolerations -}} +{{- toYaml .Values.starrocksCluster.componentValues.tolerations -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the tolerations field in the starrocksBeSpec +*/}} +{{- define "starrockscluster.be.tolerations" -}} +{{- if .Values.starrocksBeSpec.tolerations -}} +{{- toYaml .Values.starrocksBeSpec.tolerations -}} +{{- else if .Values.starrocksCluster.componentValues.tolerations -}} +{{- toYaml .Values.starrocksCluster.componentValues.tolerations -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the tolerations field in the starrocksCnSpec +*/}} +{{- define "starrockscluster.cn.tolerations" -}} +{{- if .Values.starrocksCnSpec.tolerations -}} +{{- toYaml .Values.starrocksCnSpec.tolerations -}} +{{- else if .Values.starrocksCluster.componentValues.tolerations -}} +{{- toYaml .Values.starrocksCluster.componentValues.tolerations -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the nodeSelector field in the starrocksFESpec +*/}} +{{- define "starrockscluster.fe.nodeSelector" -}} +{{- if .Values.starrocksFESpec.nodeSelector -}} +{{- toYaml .Values.starrocksFESpec.nodeSelector -}} +{{- else if .Values.starrocksCluster.componentValues.nodeSelector -}} +{{- toYaml .Values.starrocksCluster.componentValues.nodeSelector -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the nodeSelector field in the starrocksBeSpec +*/}} +{{- define "starrockscluster.be.nodeSelector" -}} +{{- if .Values.starrocksBeSpec.nodeSelector -}} +{{- toYaml .Values.starrocksBeSpec.nodeSelector -}} +{{- else if .Values.starrocksCluster.componentValues.nodeSelector -}} +{{- toYaml .Values.starrocksCluster.componentValues.nodeSelector -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the nodeSelector field in the starrocksCnSpec +*/}} +{{- define "starrockscluster.cn.nodeSelector" -}} +{{- if .Values.starrocksCnSpec.nodeSelector -}} +{{- toYaml .Values.starrocksCnSpec.nodeSelector -}} +{{- else if .Values.starrocksCluster.componentValues.nodeSelector -}} +{{- toYaml .Values.starrocksCluster.componentValues.nodeSelector -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the affinity field in the starrocksFESpec +*/}} +{{- define "starrockscluster.fe.affinity" -}} +{{- if .Values.starrocksFESpec.affinity -}} +{{- toYaml .Values.starrocksFESpec.affinity -}} +{{- else if .Values.starrocksCluster.componentValues.affinity -}} +{{- toYaml .Values.starrocksCluster.componentValues.affinity -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the affinity field in the starrocksBeSpec +*/}} +{{- define "starrockscluster.be.affinity" -}} +{{- if .Values.starrocksBeSpec.affinity -}} +{{- toYaml .Values.starrocksBeSpec.affinity -}} +{{- else if .Values.starrocksCluster.componentValues.affinity -}} +{{- toYaml .Values.starrocksCluster.componentValues.affinity -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the affinity field in the starrocksCnSpec +*/}} +{{- define "starrockscluster.cn.affinity" -}} +{{- if .Values.starrocksCnSpec.affinity -}} +{{- toYaml .Values.starrocksCnSpec.affinity -}} +{{- else if .Values.starrocksCluster.componentValues.affinity -}} +{{- toYaml .Values.starrocksCluster.componentValues.affinity -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the topologySpreadConstraints field in the starrocksFESpec +*/}} +{{- define "starrockscluster.fe.topologySpreadConstraints" -}} +{{- if .Values.starrocksFESpec.topologySpreadConstraints -}} +{{- toYaml .Values.starrocksFESpec.topologySpreadConstraints -}} +{{- else if .Values.starrocksCluster.componentValues.topologySpreadConstraints -}} +{{- toYaml .Values.starrocksCluster.componentValues.topologySpreadConstraints -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the topologySpreadConstraints field in the starrocksBeSpec +*/}} +{{- define "starrockscluster.be.topologySpreadConstraints" -}} +{{- if .Values.starrocksBeSpec.topologySpreadConstraints -}} +{{- toYaml .Values.starrocksBeSpec.topologySpreadConstraints -}} +{{- else if .Values.starrocksCluster.componentValues.topologySpreadConstraints -}} +{{- toYaml .Values.starrocksCluster.componentValues.topologySpreadConstraints -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the topologySpreadConstraints field in the starrocksCnSpec +*/}} +{{- define "starrockscluster.cn.topologySpreadConstraints" -}} +{{- if .Values.starrocksCnSpec.topologySpreadConstraints -}} +{{- toYaml .Values.starrocksCnSpec.topologySpreadConstraints -}} +{{- else if .Values.starrocksCluster.componentValues.topologySpreadConstraints -}} +{{- toYaml .Values.starrocksCluster.componentValues.topologySpreadConstraints -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the runAsNonRoot field in the starrocksFESpec +*/}} +{{- define "starrockscluster.fe.runAsNonRoot" -}} +{{- if .Values.starrocksFESpec.runAsNonRoot -}} +{{- .Values.starrocksFESpec.runAsNonRoot -}} +{{- else if .Values.starrocksCluster.componentValues.runAsNonRoot -}} +{{- .Values.starrocksCluster.componentValues.runAsNonRoot -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the runAsNonRoot field in the starrocksBeSpec +*/}} +{{- define "starrockscluster.be.runAsNonRoot" -}} +{{- if .Values.starrocksBeSpec.runAsNonRoot -}} +{{- .Values.starrocksBeSpec.runAsNonRoot -}} +{{- else if .Values.starrocksCluster.componentValues.runAsNonRoot -}} +{{- .Values.starrocksCluster.componentValues.runAsNonRoot -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of the runAsNonRoot field in the starrocksCnSpec +*/}} +{{- define "starrockscluster.cn.runAsNonRoot" -}} +{{- if .Values.starrocksCnSpec.runAsNonRoot -}} +{{- .Values.starrocksCnSpec.runAsNonRoot -}} +{{- else if .Values.starrocksCluster.componentValues.runAsNonRoot -}} +{{- .Values.starrocksCluster.componentValues.runAsNonRoot -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of hostAliases field in the starrocksFESpec +*/}} +{{- define "starrockscluster.fe.hostAliases" -}} +{{- if .Values.starrocksFESpec.hostAliases -}} +{{- toYaml .Values.starrocksFESpec.hostAliases -}} +{{- else if .Values.starrocksCluster.componentValues.hostAliases -}} +{{- toYaml .Values.starrocksCluster.componentValues.hostAliases -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of hostAliases field in the starrocksBeSpec +*/}} +{{- define "starrockscluster.be.hostAliases" -}} +{{- if .Values.starrocksBeSpec.hostAliases -}} +{{- toYaml .Values.starrocksBeSpec.hostAliases -}} +{{- else if .Values.starrocksCluster.componentValues.hostAliases -}} +{{- toYaml .Values.starrocksCluster.componentValues.hostAliases -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of hostAliases field in the starrocksCnSpec +*/}} +{{- define "starrockscluster.cn.hostAliases" -}} +{{- if .Values.starrocksCnSpec.hostAliases -}} +{{- toYaml .Values.starrocksCnSpec.hostAliases -}} +{{- else if .Values.starrocksCluster.componentValues.hostAliases -}} +{{- toYaml .Values.starrocksCluster.componentValues.hostAliases -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of tag field in the starrocksFESpec +*/}} +{{- define "starrockscluster.fe.image.tag" -}} +{{- if .Values.starrocksFESpec.image.tag -}} +{{- .Values.starrocksFESpec.image.tag -}} +{{- else if .Values.starrocksCluster.componentValues.image.tag -}} +{{- .Values.starrocksCluster.componentValues.image.tag -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of tag field in the starrocksBeSpec +*/}} +{{- define "starrockscluster.be.image.tag" -}} +{{- if .Values.starrocksBeSpec.image.tag -}} +{{- .Values.starrocksBeSpec.image.tag -}} +{{- else if .Values.starrocksCluster.componentValues.image.tag -}} +{{- .Values.starrocksCluster.componentValues.image.tag -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of tag field in the starrocksCnSpec +*/}} +{{- define "starrockscluster.cn.image.tag" -}} +{{- if .Values.starrocksCnSpec.image.tag -}} +{{- .Values.starrocksCnSpec.image.tag -}} +{{- else if .Values.starrocksCluster.componentValues.image.tag -}} +{{- .Values.starrocksCluster.componentValues.image.tag -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of podLabels field in the starrocksFESpec +*/}} +{{- define "starrockscluster.fe.podLabels" -}} +{{- if .Values.starrocksFESpec.podLabels -}} +{{- toYaml .Values.starrocksFESpec.podLabels -}} +{{- else if .Values.starrocksCluster.componentValues.podLabels -}} +{{- toYaml .Values.starrocksCluster.componentValues.podLabels -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of podLabels field in the starrocksBeSpec +*/}} +{{- define "starrockscluster.be.podLabels" -}} +{{- if .Values.starrocksBeSpec.podLabels -}} +{{- toYaml .Values.starrocksBeSpec.podLabels -}} +{{- else if .Values.starrocksCluster.componentValues.podLabels -}} +{{- toYaml .Values.starrocksCluster.componentValues.podLabels -}} +{{- end -}} +{{- end -}} + +{{/* +Get the value of podLabels field in the starrocksCnSpec +*/}} +{{- define "starrockscluster.cn.podLabels" -}} +{{- if .Values.starrocksCnSpec.podLabels -}} +{{- toYaml .Values.starrocksCnSpec.podLabels -}} +{{- else if .Values.starrocksCluster.componentValues.podLabels -}} +{{- toYaml .Values.starrocksCluster.componentValues.podLabels -}} +{{- end -}} +{{- end -}} diff --git a/charts/starrocks/templates/beconfigmap.yaml b/charts/starrocks/templates/beconfigmap.yaml new file mode 100644 index 0000000..f00c39d --- /dev/null +++ b/charts/starrocks/templates/beconfigmap.yaml @@ -0,0 +1,14 @@ +{{- if and .Values.starrocksCluster.enabledBe .Values.starrocksBeSpec .Values.starrocksBeSpec.config }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "starrockscluster.be.configmap.name" . }} + namespace: {{ template "starrockscluster.namespace" . }} + labels: + cluster: {{ template "starrockscluster.name" . }} + app: "be" +data: + {{- include "starrockscluster.be.config" . | nindent 2 }} + +{{- end }} + diff --git a/charts/starrocks/templates/cnconfigmap.yaml b/charts/starrocks/templates/cnconfigmap.yaml new file mode 100644 index 0000000..39d2a3a --- /dev/null +++ b/charts/starrocks/templates/cnconfigmap.yaml @@ -0,0 +1,13 @@ +{{- if and .Values.starrocksCluster.enabledCn .Values.starrocksCnSpec .Values.starrocksCnSpec.config }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "starrockscluster.cn.configmap.name" . }} + namespace: {{ template "starrockscluster.namespace" . }} + labels: + cluster: {{ template "starrockscluster.name" . }} + app: "cn" +data: + {{- include "starrockscluster.cn.config" . | nindent 2 }} + +{{- end }} diff --git a/charts/starrocks/templates/configmaps.yaml b/charts/starrocks/templates/configmaps.yaml new file mode 100644 index 0000000..10ce488 --- /dev/null +++ b/charts/starrocks/templates/configmaps.yaml @@ -0,0 +1,50 @@ +{{- range .Values.configMaps }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .name }} +data: + {{- range $key, $value := .data }} + {{- if $value }} + {{ $key }}: | + {{- $value | nindent 4 }} + {{- end }} + {{- end }} +--- +{{- end }} + +--- + +{{- if .Values.starrocksFESpec.entrypoint }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "starrockscluster.fe.entrypoint.script.configmap.name" .}} +data: + {{ template "starrockscluster.entrypoint.script.name" .}}: | + {{- .Values.starrocksFESpec.entrypoint.script | nindent 4 }} +{{- end }} + +--- + +{{- if .Values.starrocksBeSpec.entrypoint }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "starrockscluster.be.entrypoint.script.configmap.name" .}} +data: + {{ template "starrockscluster.entrypoint.script.name" .}}: | + {{- .Values.starrocksBeSpec.entrypoint.script | nindent 4 }} +{{- end }} + +--- + +{{- if .Values.starrocksCnSpec.entrypoint }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "starrockscluster.cn.entrypoint.script.configmap.name" .}} +data: + {{ template "starrockscluster.entrypoint.script.name" .}}: | + {{- .Values.starrocksCnSpec.entrypoint.script | nindent 4 }} +{{- end }} diff --git a/charts/starrocks/templates/feconfigmap.yaml b/charts/starrocks/templates/feconfigmap.yaml new file mode 100644 index 0000000..2a034b1 --- /dev/null +++ b/charts/starrocks/templates/feconfigmap.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "starrockscluster.fe.configmap.name" . }} + namespace: {{ template "starrockscluster.namespace" . }} + labels: + cluster: {{ template "starrockscluster.name" . }} + app: "fe" +data: + {{- include "starrockscluster.fe.config" . | nindent 2 }} diff --git a/charts/starrocks/templates/init-pwd/configmap.yaml b/charts/starrocks/templates/init-pwd/configmap.yaml new file mode 100644 index 0000000..6bd012d --- /dev/null +++ b/charts/starrocks/templates/init-pwd/configmap.yaml @@ -0,0 +1,44 @@ +{{- if .Values.initPassword.enabled }} +{{- if not .Values.initPassword.passwordSecret }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "starrockscluster.initpassword.secret.name" . }} + namespace: {{ template "starrockscluster.namespace" . }} +data: + password: {{ .Values.initPassword.password | b64enc }} +--- +{{- end }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "starrockscluster.name" . }}-initpwd-shell + namespace: {{ template "starrockscluster.namespace" . }} +data: + fe_initpwd.sh: |- + #!/bin/bash + + # ensure `mysql` command can be ended with 30 seconds + # Change the root password during initial installation + init_pwd_sql="SET PASSWORD = PASSWORD('$INIT_PWD');" + success=`mysql --connect-timeout 30 -h $1 -P $2 -u root --skip-column-names --batch -e "$init_pwd_sql" 2>&1` + if [ $? -ne 0 ] ; then + echo $success + errcode=`echo $success | awk -F " " '{print $2}'` + echo "error code: $errcode" + + # Password error, believed to have been changed, exiting normally + if [[ $errcode = '1045' || $errcode = '1064' ]] ; then + echo "Password error, believed to have been changed, exiting normally" + exit 0 + fi + + # Other unsuccessful errors, abnormal exit + echo "Other unsuccessful errors, abnormal exit" + exit 1 + + fi + + echo "Successfully modified password" + exit 0 +{{- end }} diff --git a/charts/starrocks/templates/init-pwd/job.yaml b/charts/starrocks/templates/init-pwd/job.yaml new file mode 100644 index 0000000..081ad32 --- /dev/null +++ b/charts/starrocks/templates/init-pwd/job.yaml @@ -0,0 +1,71 @@ +{{- if and .Values.initPassword.enabled .Values.initPassword.isInstall .Release.IsInstall }} +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ template "starrockscluster.name" . }}-initpwd + namespace: {{ template "starrockscluster.namespace" . }} + labels: + cluster: {{ template "starrockscluster.name" . }} + {{- if .Values.initPassword.annotations }} + annotations: + {{- toYaml .Values.initPassword.annotations | nindent 4 }} + {{- end }} +spec: + template: + {{- if .Values.initPassword.podAnnotations }} + metadata: + annotations: + {{- toYaml .Values.initPassword.podAnnotations | nindent 8 }} + {{- end }} + spec: + {{- if or .Values.starrocksFESpec.imagePullSecrets .Values.starrocksCluster.componentValues.imagePullSecrets }} + imagePullSecrets: + {{- include "starrockscluster.fe.imagePullSecrets" . | nindent 6 }} + {{- end }} + {{- if or .Values.starrocksFESpec.affinity .Values.starrocksCluster.componentValues.affinity }} + affinity: + {{- include "starrockscluster.fe.affinity" . | nindent 8 }} + {{- end }} + {{- if or .Values.starrocksFESpec.tolerations .Values.starrocksCluster.componentValues.tolerations }} + tolerations: + {{- include "starrockscluster.fe.tolerations" . | nindent 8 }} + {{- end }} + containers: + - name: {{ template "starrockscluster.name" . }}-initpwd + {{- if .Values.initPassword.image }} + image: {{ .Values.initPassword.image }} + {{- else }} + image: {{ .Values.starrocksFESpec.image.repository }}:{{ include "starrockscluster.fe.image.tag" . }} + {{- end }} + imagePullPolicy: IfNotPresent + {{- if .Values.initPassword.resources }} + resources: {{- toYaml .Values.initPassword.resources | nindent 10 }} + {{- end }} + command: + - /bin/bash + args: + - /opt/starrocks/fe_initpwd.sh + - {{ template "starrockscluster.name" . }}-fe-0.{{ template "starrockscluster.name" . }}-fe-search + - "{{- default 9030 (include "starrockscluster.fe.query.port" .) }}" + env: + - name: INIT_PWD + valueFrom: + secretKeyRef: + key: password + name: {{ template "starrockscluster.initpassword.secret.name" . }} + volumeMounts: + - mountPath: /opt/starrocks/fe_initpwd.sh + name: {{ template "starrockscluster.name" . }}-initpwd-shell + subPath: fe_initpwd.sh + volumes: + - configMap: + defaultMode: 420 + items: + - key: fe_initpwd.sh + path: fe_initpwd.sh + name: {{ template "starrockscluster.name" . }}-initpwd-shell + optional: false + name: {{ template "starrockscluster.name" . }}-initpwd-shell + restartPolicy: OnFailure + backoffLimit: 10 +{{- end }} diff --git a/charts/starrocks/templates/resources.yaml b/charts/starrocks/templates/resources.yaml new file mode 100644 index 0000000..4f29018 --- /dev/null +++ b/charts/starrocks/templates/resources.yaml @@ -0,0 +1,4 @@ +{{- range .Values.resources }} +{{- toYaml . | nindent 0 }} +--- +{{- end }} diff --git a/charts/starrocks/templates/secrets.yaml b/charts/starrocks/templates/secrets.yaml new file mode 100644 index 0000000..4e7ba48 --- /dev/null +++ b/charts/starrocks/templates/secrets.yaml @@ -0,0 +1,14 @@ +{{- range .Values.secrets }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ .name }} +type: Opaque +data: + {{- range $key, $value := .data }} + {{- if $value }} + {{ $key }}: {{ $value | b64enc }} + {{- end }} + {{- end }} +--- +{{- end }} \ No newline at end of file diff --git a/charts/starrocks/templates/servicemonitor.yaml b/charts/starrocks/templates/servicemonitor.yaml new file mode 100644 index 0000000..0b0cae2 --- /dev/null +++ b/charts/starrocks/templates/servicemonitor.yaml @@ -0,0 +1,112 @@ +{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.metrics.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "starrockscluster.fe.name" . }} + namespace: {{ template "starrockscluster.namespace" . }} + labels: + cluster: {{ template "starrockscluster.name" . }} + {{- if .Values.metrics.serviceMonitor.labels }} + {{- toYaml .Values.metrics.serviceMonitor.labels | nindent 4 }} + {{- end }} +spec: + endpoints: + - port: http + {{- with .Values.metrics.serviceMonitor.interval }} + interval: {{ . }} + {{- end }} + path: /metrics + {{- if .Values.metrics.serviceMonitor.basicAuth.enabled }} + basicAuth: + username: + name: {{ .Values.metrics.serviceMonitor.basicAuth.usernameSecretName }} + key: {{ .Values.metrics.serviceMonitor.basicAuth.usernameSecretKey }} + password: + name: {{ .Values.metrics.serviceMonitor.basicAuth.passwordSecretName }} + key: {{ .Values.metrics.serviceMonitor.basicAuth.passwordSecretKey }} + {{- end }} + {{- if .Values.metrics.serviceMonitor.endpointParam.enabled }} + params: + {{- toYaml .Values.metrics.serviceMonitor.endpointParam.params | nindent 8 }} + {{- end }} + relabelings: + - sourceLabels: [__meta_kubernetes_endpoints_label_app_starrocks_ownerreference_name] + targetLabel: app_starrocks_ownerreference_name + - sourceLabels: [__meta_kubernetes_service_label_app_kubernetes_io_component] + targetLabel: app_kubernetes_io_component + namespaceSelector: + matchNames: + - {{ template "starrockscluster.namespace" . }} + selector: + matchLabels: + app.starrocks.ownerreference/name: {{ template "starrockscluster.name" . }} + app.kubernetes.io/component: fe + +--- + +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "starrockscluster.be.name" . }} + namespace: {{ template "starrockscluster.namespace" . }} + labels: + cluster: {{ template "starrockscluster.name" . }} + {{- if .Values.metrics.serviceMonitor.labels }} + {{- toYaml .Values.metrics.serviceMonitor.labels | nindent 4 }} + {{- end }} +spec: + endpoints: + - port: webserver + {{- with .Values.metrics.serviceMonitor.interval }} + interval: {{ . }} + {{- end }} + path: /metrics + relabelings: + - sourceLabels: [__meta_kubernetes_endpoints_label_app_starrocks_ownerreference_name] + targetLabel: app_starrocks_ownerreference_name + - sourceLabels: [__meta_kubernetes_service_label_app_kubernetes_io_component] + targetLabel: app_kubernetes_io_component + namespaceSelector: + matchNames: + - {{ template "starrockscluster.namespace" . }} + selector: + matchLabels: + app.starrocks.ownerreference/name: {{ template "starrockscluster.name" . }} + app.kubernetes.io/component: be + +--- + +{{- if .Values.starrocksCluster.enabledCn }} + +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "starrockscluster.cn.name" . }} + namespace: {{ template "starrockscluster.namespace" . }} + labels: + cluster: {{ template "starrockscluster.name" . }} + {{- if .Values.metrics.serviceMonitor.labels }} + {{- toYaml .Values.metrics.serviceMonitor.labels | nindent 4 }} + {{- end }} +spec: + endpoints: + - port: webserver + {{- with .Values.metrics.serviceMonitor.interval }} + interval: {{ . }} + {{- end }} + path: /metrics + relabelings: + - sourceLabels: [__meta_kubernetes_endpoints_label_app_starrocks_ownerreference_name] + targetLabel: app_starrocks_ownerreference_name + - sourceLabels: [__meta_kubernetes_service_label_app_kubernetes_io_component] + targetLabel: app_kubernetes_io_component + namespaceSelector: + matchNames: + - {{ template "starrockscluster.namespace" . }} + selector: + matchLabels: + app.starrocks.ownerreference/name: {{ template "starrockscluster.name" . }} + app.kubernetes.io/component: cn + +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/starrocks/templates/starrockscluster.yaml b/charts/starrocks/templates/starrockscluster.yaml new file mode 100644 index 0000000..e57edfc --- /dev/null +++ b/charts/starrocks/templates/starrockscluster.yaml @@ -0,0 +1,959 @@ +apiVersion: starrocks.com/v1 +kind: StarRocksCluster +metadata: + name: {{ template "starrockscluster.name" . }} + namespace: {{ template "starrockscluster.namespace" . }} + labels: + cluster: {{ template "starrockscluster.name" . }} + {{- include "starrockscluster.labels" . | nindent 4 }} + {{- if .Values.starrocksCluster.annotations }} + annotations: + {{- toYaml .Values.starrocksCluster.annotations | nindent 4 }} + {{- end }} +spec: + {{- if .Values.starrocksCluster.disasterRecovery }} + disasterRecovery: + {{- toYaml .Values.starrocksCluster.disasterRecovery | nindent 4 }} + {{- end }} + starRocksFeSpec: + {{- if .Values.starrocksFESpec.initContainers }} + initContainers: + {{- toYaml .Values.starrocksFESpec.initContainers | nindent 6 }} + {{- end }} + {{- if .Values.starrocksFESpec.shareProcessNamespace }} + shareProcessNamespace: {{ .Values.starrocksFESpec.shareProcessNamespace }} + {{- end }} + image: "{{ .Values.starrocksFESpec.image.repository }}:{{ include "starrockscluster.fe.image.tag" . }}" + {{- if .Values.starrocksFESpec.entrypoint }} + command: ["bash", "-c"] + args: + - {{template "starrockscluster.entrypoint.mount.path" .}}/{{template "starrockscluster.entrypoint.script.name" .}} + {{- end }} + replicas: {{ .Values.starrocksFESpec.replicas }} + imagePullPolicy: {{ .Values.starrocksFESpec.imagePullPolicy }} + {{- if .Values.starrocksFESpec.maxUnavailablePods }} + updateStrategy: + rollingUpdate: + maxUnavailable: {{ .Values.starrocksFESpec.maxUnavailablePods }} + {{- end }} + {{- /* + support both resources and resource for backward compatibility + */}} + {{- if .Values.starrocksFESpec.resources }} + {{- include "starrockscluster.fe.resources" . | nindent 4 }} + {{- else if .Values.starrocksFESpec.resource }} + {{- toYaml .Values.starrocksFESpec.resource | nindent 4 }} + {{- end }} + {{- if .Values.starrocksFESpec.service.type }} + service: + type: {{ .Values.starrocksFESpec.service.type }} + {{- if and (eq "LoadBalancer" .Values.starrocksFESpec.service.type) .Values.starrocksFESpec.service.loadbalancerIP }} + loadBalancerIP: {{ .Values.starrocksFESpec.service.loadbalancerIP }} + {{- end }} + {{- if and (eq "LoadBalancer" .Values.starrocksFESpec.service.type) .Values.starrocksFESpec.service.loadBalancerSourceRanges}} + loadBalancerSourceRanges: + {{- toYaml .Values.starrocksFESpec.service.loadBalancerSourceRanges | nindent 8 }} + {{- end }} + {{- if .Values.starrocksFESpec.service.ports }} + ports: + {{- toYaml .Values.starrocksFESpec.service.ports | nindent 8 }} + {{- end }} + {{- if or .Values.starrocksFESpec.service.annotations .Values.datadog.metrics.enabled }} + annotations: + {{- if .Values.datadog.metrics.enabled }} + prometheus.io/path: "/metrics" + prometheus.io/port: "{{- default 8030 (include "starrockscluster.fe.http.port" .) }}" + prometheus.io/scrape: "true" + {{- end }} + {{- if .Values.starrocksFESpec.service.annotations}} + {{- toYaml .Values.starrocksFESpec.service.annotations | nindent 8 }} + {{- end }} + {{- end }} + {{- if .Values.starrocksFESpec.service.labels}} + labels: + {{- toYaml .Values.starrocksFESpec.service.labels | nindent 8 }} + {{- end }} + {{- end }} + annotations: + app.starrocks.io/fe-config-hash: "{{template "starrockscluster.fe.config.hash" . }}" + {{- if .Values.datadog.log.enabled }} + {{- if eq (trimAll " {}" .Values.datadog.log.logConfig) "" }} + ad.datadoghq.com/fe.logs: '[{"service":"starrocks","source":"fe"}]' + {{- else }} + ad.datadoghq.com/fe.logs: {{ printf "[%s]" (printf "{%s, \"source\": \"fe\", \"service\": \"starrocks\"}" (trimAll " {}" .Values.datadog.log.logConfig) | fromJson | toJson) | squote }} + {{- end }} + {{- end }} + {{- if .Values.starrocksFESpec.entrypoint }} + app.starrocks.io/fe-entrypoint-hash: "{{ template "starrockscluster.fe.entrypoint.script.hash" . }}" + {{- end }} + {{- if .Values.starrocksFESpec.annotations }} + {{- toYaml .Values.starrocksFESpec.annotations | nindent 6 }} + {{- end }} + {{- if or .Values.starrocksFESpec.imagePullSecrets .Values.starrocksCluster.componentValues.imagePullSecrets }} + imagePullSecrets: + {{- include "starrockscluster.fe.imagePullSecrets" . | nindent 6 }} + {{- end }} + {{- if or .Values.starrocksFESpec.serviceAccount .Values.starrocksCluster.componentValues.serviceAccount }} + serviceAccount: {{ include "starrockscluster.fe.serviceAccount" . }} + {{- end }} + runAsNonRoot: {{ include "starrockscluster.fe.runAsNonRoot" . }} + {{- if .Values.starrocksFESpec.readOnlyRootFilesystem }} + readOnlyRootFilesystem: {{ .Values.starrocksFESpec.readOnlyRootFilesystem }} + {{- end }} + {{- if .Values.starrocksFESpec.capabilities }} + capabilities: + {{- toYaml .Values.starrocksFESpec.capabilities | nindent 6 }} + {{- end }} + {{- if .Values.starrocksFESpec.sysctls }} + sysctls: + {{- toYaml .Values.starrocksFESpec.sysctls | nindent 6 }} + {{- end }} + {{- if or .Values.starrocksFESpec.nodeSelector .Values.starrocksCluster.componentValues.nodeSelector }} + nodeSelector: + {{- include "starrockscluster.fe.nodeSelector" . | nindent 6 }} + {{- end }} + {{- if or .Values.starrocksFESpec.podLabels .Values.starrocksCluster.componentValues.podLabels .Values.datadog.profiling.fe }} + podLabels: + {{- if or .Values.starrocksFESpec.podLabels .Values.starrocksCluster.componentValues.podLabels }} + {{- include "starrockscluster.fe.podLabels" . | nindent 6 }} + {{- end }} + {{- if .Values.datadog.profiling.fe }} + admission.datadoghq.com/config.mode: {{ .Values.datadog.profiling.configMode }} + admission.datadoghq.com/enabled: "true" + {{- end }} + {{- end }} + {{- if or .Values.starrocksFESpec.hostAliases .Values.starrocksCluster.componentValues.hostAliases }} + hostAliases: + {{- include "starrockscluster.fe.hostAliases" . | nindent 6 }} + {{- end }} + {{- if or .Values.starrocksFESpec.schedulerName .Values.starrocksCluster.componentValues.schedulerName }} + schedulerName: {{ include "starrockscluster.fe.schedulerName" . }} + {{- end }} + feEnvVars: + - name: TZ + value: {{ .Values.timeZone }} + {{- if .Values.datadog.log.enabled }} + - name: LOG_CONSOLE + value: "1" + {{- end }} + {{- if and .Values.initPassword.enabled (.Values.starrocksFESpec.feEnvVars | toJson | contains "MYSQL_PWD" | not) }} + - name: "MYSQL_PWD" + valueFrom: + secretKeyRef: + name: {{ template "starrockscluster.initpassword.secret.name" . }} + key: password + {{- end }} + {{- if .Values.datadog.profiling.fe }} + - name: ENABLE_DATADOG_PROFILE + value: "true" + - name: DD_PROFILING_ENABLED + value: "true" + - name: DD_SERVICE + value: starrocks-fe + - name: DD_ENV + value: "{{ .Values.datadog.profiling.env }}" + - name: DD_VERSION + value: "{{ include "starrockscluster.fe.image.tag" . }}" + - name: DD_PROFILING_DDPROF_ALLOC_ENABLED + value: "true" + - name: DD_PROFILING_DDPROF_ENABLED + value: "true" + - name: DD_PROFILING_DDPROF_LIVEHEAP_ENABLED + value: "true" + - name: DD_PROFILING_DIRECTALLOCATION_ENABLED + value: "true" + {{- end }} + {{- if .Values.starrocksFESpec.feEnvVars }} + {{- /* if it is a map, we use range to iterate to merge environment variables */}} + {{- if eq (kindOf .Values.starrocksFESpec.feEnvVars) "map" }} + {{- range $key, $value := .Values.starrocksFESpec.feEnvVars }} + - name: {{ $key }} + {{- if eq (kindOf $value) "string" }} + value: {{ $value | quote }} + {{- else }} + {{- toYaml $value | nindent 8 }} + {{- end }} + {{- end }} + {{- else }} + {{- /* the default kind is slice, we keep backward compatibility */}} + {{- toYaml .Values.starrocksFESpec.feEnvVars | nindent 6 }} + {{- end }} + {{- end }} + {{- if or .Values.starrocksFESpec.affinity .Values.starrocksCluster.componentValues.affinity }} + affinity: + {{- include "starrockscluster.fe.affinity" . | nindent 6 }} + {{- end }} + {{- if or .Values.starrocksFESpec.tolerations .Values.starrocksCluster.componentValues.tolerations }} + tolerations: + {{- include "starrockscluster.fe.tolerations" . | nindent 6 }} + {{- end }} + {{- if or .Values.starrocksFESpec.topologySpreadConstraints .Values.starrocksCluster.componentValues.topologySpreadConstraints }} + topologySpreadConstraints: + {{- include "starrockscluster.fe.topologySpreadConstraints" . | nindent 6 }} + {{- end }} + terminationGracePeriodSeconds: {{ .Values.starrocksFESpec.terminationGracePeriodSeconds }} + {{- if .Values.starrocksFESpec.startupProbeFailureSeconds }} + startupProbeFailureSeconds: {{ .Values.starrocksFESpec.startupProbeFailureSeconds }} + {{- end }} + {{- if .Values.starrocksFESpec.livenessProbeFailureSeconds }} + livenessProbeFailureSeconds: {{ .Values.starrocksFESpec.livenessProbeFailureSeconds }} + {{- end }} + {{- if .Values.starrocksFESpec.readinessProbeFailureSeconds }} + readinessProbeFailureSeconds: {{ .Values.starrocksFESpec.readinessProbeFailureSeconds }} + {{- end }} + {{- if .Values.starrocksFESpec.lifecycle }} + lifecycle: + {{- toYaml .Values.starrocksFESpec.lifecycle | nindent 6 }} + {{- end }} + {{- if and .Values.starrocksFESpec.sidecarsMap .Values.starrocksFESpec.sidecars }} + {{ fail "starrocksFESpec.sidecarsMap and starrocksFESpec.sidecars cannot be set at the same time" }} + {{- end }} + {{- if or .Values.starrocksFESpec.sidecarsMap .Values.starrocksFESpec.sidecars }} + sidecars: + {{- if .Values.starrocksFESpec.sidecarsMap }} + {{- range $name, $spec := .Values.starrocksFESpec.sidecarsMap }} + - name: {{ $name }} + {{- toYaml $spec | nindent 8 }} + {{- end }} + {{- else if .Values.starrocksFESpec.sidecars }} + {{- toYaml .Values.starrocksFESpec.sidecars | nindent 6 }} + {{- end }} + {{- end }} + {{- if .Values.starrocksFESpec.secrets }} + secrets: + {{- range .Values.starrocksFESpec.secrets }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + subPath: {{ .subPath }} + {{- end }} + {{- end }} + {{- if or .Values.starrocksFESpec.configMaps .Values.starrocksFESpec.entrypoint }} + configMaps: + {{- if .Values.starrocksFESpec.configMaps }} + {{- range .Values.starrocksFESpec.configMaps }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + subPath: {{ .subPath }} + {{- end }} + {{- end }} + {{- if .Values.starrocksFESpec.entrypoint }} + - name: {{template "starrockscluster.fe.entrypoint.script.configmap.name" .}} + mountPath: {{template "starrockscluster.entrypoint.mount.path" .}}/{{ template "starrockscluster.entrypoint.script.name" .}} + subPath: {{ template "starrockscluster.entrypoint.script.name" .}} + {{- end }} + {{- end }} + configMapInfo: + configMapName: {{ template "starrockscluster.fe.configmap.name" . }} + resolveKey: fe.conf + {{- if or .Values.starrocksFESpec.storageSpec.name .Values.starrocksFESpec.emptyDirs .Values.starrocksFESpec.hostPaths }} + storageVolumes: + {{- if .Values.starrocksFESpec.storageSpec.name }} + - name: {{ .Values.starrocksFESpec.storageSpec.name }}{{ template "starrockscluster.fe.meta.suffix" . }} + storageClassName: {{ .Values.starrocksFESpec.storageSpec.storageClassName }} + storageSize: "{{ .Values.starrocksFESpec.storageSpec.storageSize }}" + mountPath: {{ template "starrockscluster.fe.meta.path" . }} + - name: {{ .Values.starrocksFESpec.storageSpec.name }}{{ template "starrockscluster.fe.log.suffix" . }} + {{- if .Values.starrocksFESpec.storageSpec.logStorageClassName }} + storageClassName: {{ .Values.starrocksFESpec.storageSpec.logStorageClassName }} + {{- else }} + storageClassName: {{ .Values.starrocksFESpec.storageSpec.storageClassName }} + {{- end }} + storageSize: "{{ .Values.starrocksFESpec.storageSpec.logStorageSize }}" + mountPath: {{ template "starrockscluster.fe.log.path" . }} + {{- end }} + {{- if .Values.starrocksFESpec.emptyDirs }} + {{- range .Values.starrocksFESpec.emptyDirs }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + storageClassName: "emptyDir" + {{- end }} + {{- end }} + {{- if .Values.starrocksFESpec.hostPaths }} + {{- range .Values.starrocksFESpec.hostPaths }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + storageClassName: "hostPath" + hostPath: + {{- toYaml .hostPath | nindent 8 }} + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.starrocksFESpec.persistentVolumeClaimRetentionPolicy }} + persistentVolumeClaimRetentionPolicy: + {{- toYaml .Values.starrocksFESpec.persistentVolumeClaimRetentionPolicy | nindent 6 }} + {{- end }} + {{- if .Values.starrocksCluster.enabledBe }} + starRocksBeSpec: + {{- if .Values.starrocksBeSpec.initContainers }} + initContainers: + {{- toYaml .Values.starrocksBeSpec.initContainers | nindent 6 }} + {{- end }} + {{- if .Values.starrocksBeSpec.shareProcessNamespace }} + shareProcessNamespace: {{ .Values.starrocksBeSpec.shareProcessNamespace }} + {{- end }} + image: "{{ .Values.starrocksBeSpec.image.repository }}:{{ include "starrockscluster.be.image.tag" . }}" + {{- if .Values.starrocksBeSpec.entrypoint }} + command: ["bash", "-c"] + args: + - {{template "starrockscluster.entrypoint.mount.path" .}}/{{template "starrockscluster.entrypoint.script.name" .}} + {{- end }} + replicas: {{ .Values.starrocksBeSpec.replicas }} + imagePullPolicy: {{ .Values.starrocksBeSpec.imagePullPolicy }} + {{- if .Values.starrocksBeSpec.maxUnavailablePods }} + updateStrategy: + rollingUpdate: + maxUnavailable: {{ .Values.starrocksBeSpec.maxUnavailablePods }} + {{- end }} + {{- /* + support both resources and resource for backward compatibility + */}} + {{- if .Values.starrocksBeSpec.resources }} + {{- include "starrockscluster.be.resources" . | nindent 4 }} + {{- else if .Values.starrocksBeSpec.resource }} + {{- toYaml .Values.starrocksBeSpec.resource | nindent 4 }} + {{- end }} + {{- if .Values.starrocksBeSpec.service.type }} + service: + type: {{ .Values.starrocksBeSpec.service.type }} + {{- if and (eq "LoadBalancer" .Values.starrocksBeSpec.service.type) .Values.starrocksBeSpec.service.loadbalancerIP }} + loadBalancerIP: {{ .Values.starrocksBeSpec.service.loadbalancerIP }} + {{- end }} + {{- if and (eq "LoadBalancer" .Values.starrocksBeSpec.service.type) .Values.starrocksBeSpec.service.loadBalancerSourceRanges}} + loadBalancerSourceRanges: + {{- toYaml .Values.starrocksBeSpec.service.loadBalancerSourceRanges | nindent 8 }} + {{- end }} + {{- if .Values.starrocksBeSpec.service.ports }} + ports: + {{- toYaml .Values.starrocksBeSpec.service.ports | nindent 8 }} + {{- end }} + {{- if or .Values.starrocksBeSpec.service.annotations .Values.datadog.metrics.enabled }} + annotations: + {{- if .Values.datadog.metrics.enabled }} + prometheus.io/path: "/metrics" + prometheus.io/port: "{{- default 8040 (include "starrockscluster.be.webserver.port" .) }}" + prometheus.io/scrape: "true" + {{- end }} + {{- if .Values.starrocksBeSpec.service.annotations }} + {{- toYaml .Values.starrocksBeSpec.service.annotations | nindent 8 }} + {{- end }} + {{- end }} + {{- if .Values.starrocksBeSpec.service.labels}} + labels: + {{- toYaml .Values.starrocksBeSpec.service.labels | nindent 8 }} + {{- end }} + {{- end }} + annotations: + app.starrocks.io/be-config-hash: "{{template "starrockscluster.be.config.hash" . }}" + {{- if .Values.datadog.log.enabled }} + {{- if eq (trimAll " {}" .Values.datadog.log.logConfig) "" }} + ad.datadoghq.com/be.logs: '[{"service":"starrocks","source":"be"}]' + {{- else }} + ad.datadoghq.com/be.logs: {{ printf "[%s]" (printf "{%s, \"source\": \"be\", \"service\": \"starrocks\"}" (trimAll " {}" .Values.datadog.log.logConfig) | fromJson | toJson) | squote }} + {{- end }} + {{- end }} + {{- if .Values.starrocksBeSpec.annotations }} + {{- toYaml .Values.starrocksBeSpec.annotations | nindent 6 }} + {{- end }} + {{- if .Values.starrocksBeSpec.entrypoint }} + app.starrocks.io/be-entrypoint-hash: "{{ template "starrockscluster.be.entrypoint.script.hash" . }}" + {{- end }} + {{- if or .Values.starrocksBeSpec.imagePullSecrets .Values.starrocksCluster.componentValues.imagePullSecrets }} + imagePullSecrets: + {{- include "starrockscluster.be.imagePullSecrets" . | nindent 6 }} + {{- end }} + {{- if or .Values.starrocksBeSpec.serviceAccount .Values.starrocksCluster.componentValues.serviceAccount }} + serviceAccount: {{ include "starrockscluster.be.serviceAccount" . }} + {{- end }} + runAsNonRoot: {{ include "starrockscluster.be.runAsNonRoot" . }} + {{- if .Values.starrocksBeSpec.readOnlyRootFilesystem }} + readOnlyRootFilesystem: {{ .Values.starrocksBeSpec.readOnlyRootFilesystem }} + {{- end }} + {{- if or .Values.starrocksBeSpec.capabilities .Values.datadog.profiling.be }} + capabilities: + {{- if or .Values.starrocksBeSpec.capabilities.add .Values.datadog.profiling.be }} + add: + {{- if .Values.starrocksBeSpec.capabilities.add }} + {{- toYaml .Values.starrocksBeSpec.capabilities.add | nindent 8 }} + {{- end }} + {{- if .Values.datadog.profiling.be }} + {{- if and .Values.starrocksBeSpec.capabilities.add (has "PERFMON" .Values.starrocksBeSpec.capabilities.add) | not }} + - PERFMON + {{- end }} + {{- if and .Values.starrocksBeSpec.capabilities.add (has "SYS_PTRACE" .Values.starrocksBeSpec.capabilities.add) | not }} + - SYS_PTRACE + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.starrocksBeSpec.capabilities.drop }} + drop: + {{- toYaml .Values.starrocksBeSpec.capabilities.drop | nindent 8 }} + {{- end }} + {{- end }} + {{- if .Values.starrocksBeSpec.sysctls }} + sysctls: + {{- toYaml .Values.starrocksBeSpec.sysctls | nindent 6 }} + {{- end }} + {{- if or .Values.starrocksBeSpec.podLabels .Values.starrocksCluster.componentValues.podLabels .Values.datadog.profiling.be }} + podLabels: + {{- if or .Values.starrocksBeSpec.podLabels .Values.starrocksCluster.componentValues.podLabels }} + {{- include "starrockscluster.be.podLabels" . | nindent 6 }} + {{- end }} + {{- if .Values.datadog.profiling.be }} + admission.datadoghq.com/config.mode: {{ .Values.datadog.profiling.configMode }} + admission.datadoghq.com/enabled: "true" + {{- end }} + {{- end }} + {{- if or .Values.starrocksBeSpec.hostAliases .Values.starrocksCluster.componentValues.hostAliases }} + hostAliases: + {{- include "starrockscluster.be.hostAliases" . | nindent 6 }} + {{- end }} + {{- if or .Values.starrocksBeSpec.schedulerName .Values.starrocksCluster.componentValues.schedulerName }} + schedulerName: {{ include "starrockscluster.be.schedulerName" . }} + {{- end }} + {{- if or .Values.starrocksBeSpec.nodeSelector .Values.starrocksCluster.componentValues.nodeSelector }} + nodeSelector: + {{- include "starrockscluster.be.nodeSelector" . | nindent 6 }} + {{- end }} + beEnvVars: + - name: TZ + value: {{ .Values.timeZone }} + {{- if .Values.datadog.log.enabled }} + - name: LOG_CONSOLE + value: "1" + {{- end }} + {{- if and .Values.initPassword.enabled (.Values.starrocksBeSpec.beEnvVars | toJson | contains "MYSQL_PWD" | not) }} + - name: "MYSQL_PWD" + valueFrom: + secretKeyRef: + name: {{ template "starrockscluster.initpassword.secret.name" . }} + key: password + {{- end }} + {{- if .Values.datadog.profiling.be }} + - name: ENABLE_DATADOG_PROFILE + value: "true" + - name: DD_PROFILING_ENABLED + value: "true" + - name: DD_SERVICE + value: starrocks-be + - name: DD_ENV + value: "{{ .Values.datadog.profiling.env }}" + - name: DD_VERSION + value: "{{ include "starrockscluster.be.image.tag" . }}" + {{- end }} + {{- if .Values.starrocksBeSpec.beEnvVars }} + {{- /* if it is a map, we use range to iterate to merge environment variables */}} + {{- if eq (kindOf .Values.starrocksBeSpec.beEnvVars) "map" }} + {{- range $key, $value := .Values.starrocksBeSpec.beEnvVars }} + - name: {{ $key }} + {{- if eq (kindOf $value) "string" }} + value: {{ $value | quote }} + {{- else }} + {{- toYaml $value | nindent 8 }} + {{- end }} + {{- end }} + {{- else }} + {{- /* the default kind is slice, we keep backward compatibility */}} + {{- toYaml .Values.starrocksBeSpec.beEnvVars | nindent 6 }} + {{- end }} + {{- end }} + {{- if or .Values.starrocksBeSpec.affinity .Values.starrocksCluster.componentValues.affinity }} + affinity: + {{- include "starrockscluster.be.affinity" . | nindent 6 }} + {{- end }} + {{- if or .Values.starrocksBeSpec.tolerations .Values.starrocksCluster.componentValues.tolerations }} + tolerations: + {{- include "starrockscluster.be.tolerations" . | nindent 6 }} + {{- end }} + {{- if or .Values.starrocksBeSpec.topologySpreadConstraints .Values.starrocksCluster.componentValues.topologySpreadConstraints }} + topologySpreadConstraints: + {{- include "starrockscluster.be.topologySpreadConstraints" . | nindent 6 }} + {{- end }} + terminationGracePeriodSeconds: {{ .Values.starrocksBeSpec.terminationGracePeriodSeconds }} + {{- if .Values.starrocksBeSpec.startupProbeFailureSeconds }} + startupProbeFailureSeconds: {{ .Values.starrocksBeSpec.startupProbeFailureSeconds }} + {{- end }} + {{- if .Values.starrocksBeSpec.livenessProbeFailureSeconds }} + livenessProbeFailureSeconds: {{ .Values.starrocksBeSpec.livenessProbeFailureSeconds }} + {{- end }} + {{- if .Values.starrocksBeSpec.readinessProbeFailureSeconds }} + readinessProbeFailureSeconds: {{ .Values.starrocksBeSpec.readinessProbeFailureSeconds }} + {{- end }} + {{- if .Values.starrocksBeSpec.lifecycle }} + lifecycle: + {{- toYaml .Values.starrocksBeSpec.lifecycle | nindent 6 }} + {{- end }} + {{- if and .Values.starrocksBeSpec.sidecarsMap .Values.starrocksBeSpec.sidecars }} + {{ fail "starrocksBeSpec.sidecarsMap and starrocksBeSpec.sidecars cannot be set at the same time" }} + {{- end }} + {{- if or .Values.starrocksBeSpec.sidecarsMap .Values.starrocksBeSpec.sidecars }} + sidecars: + {{- if .Values.starrocksBeSpec.sidecarsMap }} + {{- range $name, $spec := .Values.starrocksBeSpec.sidecarsMap }} + - name: {{ $name }} + {{- toYaml $spec | nindent 8 }} + {{- end }} + {{- else if .Values.starrocksBeSpec.sidecars }} + {{- toYaml .Values.starrocksBeSpec.sidecars | nindent 6 }} + {{- end }} + {{- end }} + {{- if .Values.starrocksBeSpec.secrets }} + secrets: + {{- range .Values.starrocksBeSpec.secrets }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + subPath: {{ .subPath }} + {{- end }} + {{- end }} + {{- if or .Values.starrocksBeSpec.configMaps .Values.starrocksBeSpec.entrypoint }} + configMaps: + {{- if .Values.starrocksBeSpec.configMaps }} + {{- range .Values.starrocksBeSpec.configMaps }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + subPath: {{ .subPath }} + {{- end }} + {{- end }} + {{- if .Values.starrocksBeSpec.entrypoint }} + - name: {{template "starrockscluster.be.entrypoint.script.configmap.name" .}} + mountPath: {{template "starrockscluster.entrypoint.mount.path" .}}/{{ template "starrockscluster.entrypoint.script.name" .}} + subPath: {{ template "starrockscluster.entrypoint.script.name" .}} + {{- end }} + {{- end }} + configMapInfo: + configMapName: {{template "starrockscluster.be.configmap.name" . }} + resolveKey: be.conf + {{- if or .Values.starrocksBeSpec.storageSpec.name .Values.starrocksBeSpec.emptyDirs .Values.starrocksBeSpec.hostPaths }} + storageVolumes: + {{- if .Values.starrocksBeSpec.storageSpec.name }} + {{- if gt (int .Values.starrocksBeSpec.storageSpec.storageCount) 1 }} + {{- $storageName := .Values.starrocksBeSpec.storageSpec.name -}} + {{- $storageClassName := .Values.starrocksBeSpec.storageSpec.storageClassName -}} + {{- $storageSize := .Values.starrocksBeSpec.storageSpec.storageSize -}} + {{- $storageMountPath := include "starrockscluster.be.data.path" . -}} + {{- range $i, $e := until (int .Values.starrocksBeSpec.storageSpec.storageCount) }} + - name: {{ $storageName }}{{ $i }}{{template "starrockscluster.be.data.suffix" . }} + storageClassName: {{ $storageClassName }} + storageSize: "{{ $storageSize }}" + mountPath: {{ $storageMountPath }}{{ $i }} + {{- end }} + {{- else}} + - name: {{ .Values.starrocksBeSpec.storageSpec.name }}{{template "starrockscluster.be.data.suffix" . }} + storageClassName: {{ .Values.starrocksBeSpec.storageSpec.storageClassName }} + storageSize: "{{ .Values.starrocksBeSpec.storageSpec.storageSize }}" + mountPath: {{template "starrockscluster.be.data.path" . }} + {{- end }} + - name: {{ .Values.starrocksBeSpec.storageSpec.name }}{{template "starrockscluster.be.log.suffix" . }} + {{- if .Values.starrocksBeSpec.storageSpec.logStorageClassName }} + storageClassName: {{ .Values.starrocksBeSpec.storageSpec.logStorageClassName }} + {{- else }} + storageClassName: {{ .Values.starrocksBeSpec.storageSpec.storageClassName }} + {{- end }} + storageSize: "{{ .Values.starrocksBeSpec.storageSpec.logStorageSize }}" + mountPath: {{template "starrockscluster.be.log.path" . }} + - name: {{ .Values.starrocksBeSpec.storageSpec.name }}{{template "starrockscluster.be.spill.suffix" . }} + {{- if .Values.starrocksBeSpec.storageSpec.spillStorageClassName }} + storageClassName: {{ .Values.starrocksBeSpec.storageSpec.spillStorageClassName }} + {{- else }} + storageClassName: {{ .Values.starrocksBeSpec.storageSpec.storageClassName }} + {{- end }} + storageSize: "{{ .Values.starrocksBeSpec.storageSpec.spillStorageSize}}" + mountPath: {{template "starrockscluster.be.spill.path" . }} + {{- end }} + {{- if .Values.starrocksBeSpec.emptyDirs }} + {{- range .Values.starrocksBeSpec.emptyDirs }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + storageClassName: "emptyDir" + {{- end }} + {{- end }} + {{- if .Values.starrocksBeSpec.hostPaths }} + {{- range .Values.starrocksBeSpec.hostPaths }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + storageClassName: "hostPath" + hostPath: + {{- toYaml .hostPath | nindent 8 }} + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.starrocksBeSpec.persistentVolumeClaimRetentionPolicy }} + persistentVolumeClaimRetentionPolicy: + {{- toYaml .Values.starrocksBeSpec.persistentVolumeClaimRetentionPolicy | nindent 6 }} + {{- end }} + {{- end }} + {{- if .Values.starrocksCluster.enabledCn }} + starRocksCnSpec: + {{- if .Values.starrocksCnSpec.initContainers }} + initContainers: + {{- toYaml .Values.starrocksCnSpec.initContainers | nindent 6 }} + {{- end }} + {{- if .Values.starrocksCnSpec.shareProcessNamespace }} + shareProcessNamespace: {{ .Values.starrocksCnSpec.shareProcessNamespace }} + {{- end }} + image: "{{ .Values.starrocksCnSpec.image.repository }}:{{ include "starrockscluster.cn.image.tag" . }}" + {{- if .Values.starrocksCnSpec.entrypoint }} + command: ["bash", "-c"] + args: + - {{template "starrockscluster.entrypoint.mount.path" .}}/{{template "starrockscluster.entrypoint.script.name" .}} + {{- end }} + {{- if hasKey .Values.starrocksCnSpec "replicas" }} + replicas: {{ .Values.starrocksCnSpec.replicas }} + {{- end }} + imagePullPolicy: {{ .Values.starrocksCnSpec.imagePullPolicy }} + {{- if .Values.starrocksCnSpec.maxUnavailablePods }} + updateStrategy: + rollingUpdate: + maxUnavailable: {{ .Values.starrocksCnSpec.maxUnavailablePods }} + {{- end }} + {{- if or .Values.starrocksCnSpec.serviceAccount .Values.starrocksCluster.componentValues.serviceAccount }} + serviceAccount: {{ include "starrockscluster.cn.serviceAccount" . }} + {{- end }} + runAsNonRoot: {{ include "starrockscluster.cn.runAsNonRoot" . }} + {{- if .Values.starrocksCnSpec.readOnlyRootFilesystem }} + readOnlyRootFilesystem: {{ .Values.starrocksCnSpec.readOnlyRootFilesystem }} + {{- end }} + {{- if or .Values.starrocksCnSpec.capabilities .Values.datadog.profiling.cn }} + capabilities: + {{- if or .Values.starrocksCnSpec.capabilities.add .Values.datadog.profiling.cn }} + add: + {{- if .Values.starrocksCnSpec.capabilities.add }} + {{- toYaml .Values.starrocksCnSpec.capabilities.add | nindent 8 }} + {{- end }} + {{- if .Values.datadog.profiling.cn }} + {{- if and .Values.starrocksCnSpec.capabilities.add (has "PERFMON" .Values.starrocksCnSpec.capabilities.add) | not }} + - PERFMON + {{- end }} + {{- if and .Values.starrocksCnSpec.capabilities.add (has "SYS_PTRACE" .Values.starrocksCnSpec.capabilities.add) | not }} + - SYS_PTRACE + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.starrocksCnSpec.capabilities.drop }} + drop: + {{- toYaml .Values.starrocksCnSpec.capabilities.drop | nindent 8 }} + {{- end }} + {{- end }} + {{- if .Values.starrocksCnSpec.sysctls }} + sysctls: + {{- toYaml .Values.starrocksCnSpec.sysctls | nindent 6 }} + {{- end }} + {{- if or .Values.starrocksCnSpec.podLabels .Values.starrocksCluster.componentValues.podLabels .Values.datadog.profiling.cn }} + podLabels: + {{- if or .Values.starrocksCnSpec.podLabels .Values.starrocksCluster.componentValues.podLabels }} + {{- include "starrockscluster.cn.podLabels" . | nindent 6 }} + {{- end }} + {{- if .Values.datadog.profiling.cn }} + admission.datadoghq.com/config.mode: {{ .Values.datadog.profiling.configMode }} + admission.datadoghq.com/enabled: "true" + {{- end }} + {{- end }} + {{- if or .Values.starrocksCnSpec.hostAliases .Values.starrocksCluster.componentValues.hostAliases }} + hostAliases: + {{- include "starrockscluster.cn.hostAliases" . | nindent 6 }} + {{- end }} + {{- if or .Values.starrocksCnSpec.schedulerName .Values.starrocksCluster.componentValues.schedulerName }} + schedulerName: {{ include "starrockscluster.cn.schedulerName" . }} + {{- end }} + {{- if or .Values.starrocksCnSpec.nodeSelector .Values.starrocksCluster.componentValues.nodeSelector }} + nodeSelector: + {{- include "starrockscluster.cn.nodeSelector" . | nindent 6 }} + {{- end }} + cnEnvVars: + - name: TZ + value: {{ .Values.timeZone }} + {{- if .Values.datadog.log.enabled }} + - name: LOG_CONSOLE + value: "1" + {{- end }} + {{- if and .Values.initPassword.enabled (.Values.starrocksCnSpec.cnEnvVars | toJson | contains "MYSQL_PWD" | not) }} + - name: "MYSQL_PWD" + valueFrom: + secretKeyRef: + name: {{ template "starrockscluster.initpassword.secret.name" . }} + key: password + {{- end }} + {{- if .Values.datadog.profiling.cn }} + - name: ENABLE_DATADOG_PROFILE + value: "true" + - name: DD_PROFILING_ENABLED + value: "true" + - name: DD_SERVICE + value: starrocks-cn + - name: DD_ENV + value: "{{ .Values.datadog.profiling.env }}" + - name: DD_VERSION + value: "{{ include "starrockscluster.cn.image.tag" . }}" + {{- end }} + {{- if .Values.starrocksCnSpec.cnEnvVars }} + {{- /* if it is a map, we use range to iterate to merge environment variables */}} + {{- if eq (kindOf .Values.starrocksCnSpec.cnEnvVars) "map" }} + {{- range $key, $value := .Values.starrocksCnSpec.cnEnvVars }} + - name: {{ $key }} + {{- if eq (kindOf $value) "string" }} + value: {{ $value | quote }} + {{- else }} + {{- toYaml $value | nindent 8 }} + {{- end }} + {{- end }} + {{- else }} + {{- /* the default kind is slice, we keep backward compatibility */}} + {{- toYaml .Values.starrocksCnSpec.cnEnvVars | nindent 6 }} + {{- end }} + {{- end }} + + {{- if or .Values.starrocksCnSpec.affinity .Values.starrocksCluster.componentValues.affinity }} + affinity: + {{- include "starrockscluster.cn.affinity" . | nindent 6 }} + {{- end }} + {{- if or .Values.starrocksCnSpec.tolerations .Values.starrocksCluster.componentValues.tolerations }} + tolerations: + {{- include "starrockscluster.cn.tolerations" . | nindent 6 }} + {{- end }} + {{- if or .Values.starrocksCnSpec.topologySpreadConstraints .Values.starrocksCluster.componentValues.topologySpreadConstraints }} + topologySpreadConstraints: + {{- include "starrockscluster.cn.topologySpreadConstraints" . | nindent 6 }} + {{- end }} + terminationGracePeriodSeconds: {{ .Values.starrocksCnSpec.terminationGracePeriodSeconds }} + {{- if .Values.starrocksCnSpec.startupProbeFailureSeconds }} + startupProbeFailureSeconds: {{ .Values.starrocksCnSpec.startupProbeFailureSeconds }} + {{- end }} + {{- if .Values.starrocksCnSpec.livenessProbeFailureSeconds }} + livenessProbeFailureSeconds: {{ .Values.starrocksCnSpec.livenessProbeFailureSeconds }} + {{- end }} + {{- if .Values.starrocksCnSpec.readinessProbeFailureSeconds }} + readinessProbeFailureSeconds: {{ .Values.starrocksCnSpec.readinessProbeFailureSeconds }} + {{- end }} + {{- if .Values.starrocksCnSpec.lifecycle }} + lifecycle: + {{- toYaml .Values.starrocksCnSpec.lifecycle | nindent 6 }} + {{- end }} + {{- if and .Values.starrocksCnSpec.sidecarsMap .Values.starrocksCnSpec.sidecars }} + {{ fail "starrocksCnSpec.sidecarsMap and starrocksCnSpec.sidecars cannot be set at the same time" }} + {{- end }} + {{- if or .Values.starrocksCnSpec.sidecarsMap .Values.starrocksCnSpec.sidecars }} + sidecars: + {{- if .Values.starrocksCnSpec.sidecarsMap }} + {{- range $name, $spec := .Values.starrocksCnSpec.sidecarsMap }} + - name: {{ $name }} + {{- toYaml $spec | nindent 8 }} + {{- end }} + {{- else if .Values.starrocksCnSpec.sidecars }} + {{- toYaml .Values.starrocksCnSpec.sidecars | nindent 6 }} + {{- end }} + {{- end }} + {{- if and .Values.starrocksCluster.enabledCn .Values.starrocksCnSpec.autoScalingPolicy }} + autoScalingPolicy: + {{- toYaml .Values.starrocksCnSpec.autoScalingPolicy | nindent 6 }} + {{- end }} + {{- /* + support both resources and resource for backward compatibility + */}} + {{- if .Values.starrocksCnSpec.resources }} + {{- include "starrockscluster.cn.resources" . | nindent 4 }} + {{- else if .Values.starrocksCnSpec.resource }} + {{- toYaml .Values.starrocksCnSpec.resource | nindent 4 }} + {{- end }} + {{- if .Values.starrocksCnSpec.service.type }} + service: + type: {{ .Values.starrocksCnSpec.service.type }} + {{- if and (eq "LoadBalancer" .Values.starrocksCnSpec.service.type) .Values.starrocksCnSpec.service.loadbalancerIP }} + loadBalancerIP: {{ .Values.starrocksCnSpec.service.loadbalancerIP }} + {{- end }} + {{- if and (eq "LoadBalancer" .Values.starrocksCnSpec.service.type) .Values.starrocksCnSpec.service.loadBalancerSourceRanges}} + loadBalancerSourceRanges: + {{- toYaml .Values.starrocksCnSpec.service.loadBalancerSourceRanges | nindent 8 }} + {{- end }} + {{- if .Values.starrocksCnSpec.service.ports }} + ports: + {{- toYaml .Values.starrocksCnSpec.service.ports | nindent 8 }} + {{- end }} + {{- if or .Values.starrocksCnSpec.service.annotations .Values.datadog.metrics.enabled }} + annotations: + {{- if .Values.datadog.metrics.enabled }} + prometheus.io/path: "/metrics" + prometheus.io/port: "{{- default 8040 (include "starrockscluster.cn.webserver.port" .) }}" + prometheus.io/scrape: "true" + {{- end }} + {{- if .Values.starrocksCnSpec.service.annotations }} + {{- toYaml .Values.starrocksCnSpec.service.annotations | nindent 8 }} + {{- end }} + {{- end }} + {{- if .Values.starrocksCnSpec.service.labels}} + labels: + {{- toYaml .Values.starrocksCnSpec.service.labels | nindent 8 }} + {{- end }} + {{- end }} + annotations: + app.starrocks.io/cn-config-hash: "{{template "starrockscluster.cn.config.hash" . }}" + {{- if .Values.datadog.log.enabled }} + {{- if eq (trimAll " {}" .Values.datadog.log.logConfig) "" }} + ad.datadoghq.com/cn.logs: '[{"service":"starrocks","source":"cn"}]' + {{- else }} + ad.datadoghq.com/cn.logs: {{ printf "[%s]" (printf "{%s, \"source\": \"cn\", \"service\": \"starrocks\"}" (trimAll " {}" .Values.datadog.log.logConfig) | fromJson | toJson) | squote }} + {{- end }} + {{- end }} + {{- if .Values.starrocksCnSpec.annotations }} + {{- toYaml .Values.starrocksCnSpec.annotations | nindent 6 }} + {{- end }} + {{- if .Values.starrocksCnSpec.entrypoint }} + app.starrocks.io/cn-entrypoint-hash: "{{ template "starrockscluster.cn.entrypoint.script.hash" . }}" + {{- end }} + {{- if or .Values.starrocksCnSpec.imagePullSecrets .Values.starrocksCluster.componentValues.imagePullSecrets }} + imagePullSecrets: + {{- include "starrockscluster.cn.imagePullSecrets" . | nindent 6 }} + {{- end }} + {{- if .Values.starrocksCnSpec.secrets }} + secrets: + {{- range .Values.starrocksCnSpec.secrets }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + subPath: {{ .subPath }} + {{- end }} + {{- end }} + {{- if or .Values.starrocksCnSpec.configMaps .Values.starrocksCnSpec.entrypoint }} + configMaps: + {{- if .Values.starrocksCnSpec.configMaps }} + {{- range .Values.starrocksCnSpec.configMaps }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + subPath: {{ .subPath }} + {{- end }} + {{- end }} + {{- if .Values.starrocksCnSpec.entrypoint }} + - name: {{template "starrockscluster.cn.entrypoint.script.configmap.name" .}} + mountPath: {{template "starrockscluster.entrypoint.mount.path" .}}/{{ template "starrockscluster.entrypoint.script.name" .}} + subPath: {{ template "starrockscluster.entrypoint.script.name" .}} + {{- end }} + {{- end }} + configMapInfo: + configMapName: {{template "starrockscluster.cn.configmap.name" . }} + resolveKey: cn.conf + {{- if or .Values.starrocksCnSpec.storageSpec.name .Values.starrocksCnSpec.emptyDirs .Values.starrocksCnSpec.hostPaths }} + storageVolumes: + {{- if .Values.starrocksCnSpec.storageSpec.name }} + {{- if gt (int .Values.starrocksCnSpec.storageSpec.storageCount) 1 }} + {{- $storageName := .Values.starrocksCnSpec.storageSpec.name -}} + {{- $storageClassName := .Values.starrocksCnSpec.storageSpec.storageClassName -}} + {{- $storageSize := .Values.starrocksCnSpec.storageSpec.storageSize -}} + {{- $storageMountPath := include "starrockscluster.cn.data.path" . -}} + {{- range $i, $e := until (int .Values.starrocksCnSpec.storageSpec.storageCount) }} + - name: {{ $storageName }}{{ $i }}{{template "starrockscluster.cn.data.suffix" . }} + storageClassName: {{ $storageClassName }} + storageSize: "{{ $storageSize }}" + mountPath: {{ $storageMountPath }}{{ $i }} + {{- end }} + {{- else }} + - name: {{ .Values.starrocksCnSpec.storageSpec.name }}{{template "starrockscluster.cn.data.suffix" . }} + storageClassName: {{ .Values.starrocksCnSpec.storageSpec.storageClassName }} + storageSize: "{{ .Values.starrocksCnSpec.storageSpec.storageSize }}" + mountPath: {{template "starrockscluster.cn.data.path" . }} + {{- end }} + - name: {{ .Values.starrocksCnSpec.storageSpec.name }}{{template "starrockscluster.cn.log.suffix" . }} + {{- if .Values.starrocksCnSpec.storageSpec.logStorageClassName }} + storageClassName: {{ .Values.starrocksCnSpec.storageSpec.logStorageClassName }} + {{- else }} + storageClassName: {{ .Values.starrocksCnSpec.storageSpec.storageClassName }} + {{- end }} + storageSize: "{{ .Values.starrocksCnSpec.storageSpec.logStorageSize }}" + mountPath: {{template "starrockscluster.cn.log.path" . }} + - name: {{ .Values.starrocksCnSpec.storageSpec.name }}{{template "starrockscluster.cn.spill.suffix" . }} + {{- if .Values.starrocksCnSpec.storageSpec.spillStorageClassName }} + storageClassName: {{ .Values.starrocksCnSpec.storageSpec.spillStorageClassName }} + {{- else }} + storageClassName: {{ .Values.starrocksCnSpec.storageSpec.storageClassName }} + {{- end }} + storageSize: "{{ .Values.starrocksCnSpec.storageSpec.spillStorageSize}}" + mountPath: {{template "starrockscluster.cn.spill.path" . }} + {{- end }} + {{- if .Values.starrocksCnSpec.emptyDirs }} + {{- range .Values.starrocksCnSpec.emptyDirs }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + storageClassName: "emptyDir" + {{- end }} + {{- end }} + {{- if .Values.starrocksCnSpec.hostPaths }} + {{- range .Values.starrocksCnSpec.hostPaths }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + storageClassName: "hostPath" + hostPath: + {{- toYaml .hostPath | nindent 8 }} + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.starrocksCnSpec.persistentVolumeClaimRetentionPolicy }} + persistentVolumeClaimRetentionPolicy: + {{- toYaml .Values.starrocksCnSpec.persistentVolumeClaimRetentionPolicy | nindent 6 }} + {{- end }} + {{- end }} + + {{- if .Values.starrocksFeProxySpec.enabled }} + starRocksFeProxySpec: + {{- if .Values.starrocksFeProxySpec.image.repository }} + image: "{{ .Values.starrocksFeProxySpec.image.repository }}:{{ .Values.starrocksFeProxySpec.image.tag }}" + {{- end }} + {{- if .Values.starrocksFeProxySpec.imagePullSecrets }} + imagePullSecrets: + {{- toYaml .Values.starrocksFeProxySpec.imagePullSecrets | nindent 4 }} + {{- end }} + replicas: {{ .Values.starrocksFeProxySpec.replicas }} + imagePullPolicy: {{ .Values.starrocksFeProxySpec.imagePullPolicy }} + resolver: {{ .Values.starrocksFeProxySpec.resolver }} + {{- if .Values.starrocksFeProxySpec.resources }} + {{- toYaml .Values.starrocksFeProxySpec.resources | nindent 4 }} + {{- end }} + {{- if .Values.starrocksFeProxySpec.service.type }} + service: + type: {{ .Values.starrocksFeProxySpec.service.type }} + {{- if .Values.starrocksFeProxySpec.service.annotations }} + annotations: + {{- toYaml .Values.starrocksFeProxySpec.service.annotations | nindent 8 }} + {{- end }} + {{- if .Values.starrocksFeProxySpec.service.labels}} + labels: + {{- toYaml .Values.starrocksFeProxySpec.service.labels | nindent 8 }} + {{- end }} + {{- if and (eq "LoadBalancer" .Values.starrocksFeProxySpec.service.type) .Values.starrocksFeProxySpec.service.loadbalancerIP }} + loadBalancerIP: {{ .Values.starrocksFeProxySpec.service.loadbalancerIP }} + {{- end }} + {{- if and (eq "LoadBalancer" .Values.starrocksFeProxySpec.service.type) .Values.starrocksFeProxySpec.service.loadBalancerSourceRanges}} + loadBalancerSourceRanges: + {{- toYaml .Values.starrocksFeProxySpec.service.loadBalancerSourceRanges | nindent 8 }} + {{- end }} + {{- if .Values.starrocksFeProxySpec.service.ports }} + ports: + {{- toYaml .Values.starrocksFeProxySpec.service.ports | nindent 8 }} + {{- end }} + {{- end }} + {{- if .Values.starrocksFeProxySpec.nodeSelector }} + nodeSelector: + {{- toYaml .Values.starrocksFeProxySpec.nodeSelector | nindent 6 }} + {{- end }} + {{- if .Values.starrocksFeProxySpec.affinity }} + affinity: + {{- toYaml .Values.starrocksFeProxySpec.affinity | nindent 6 }} + {{- end }} + {{- if .Values.starrocksFeProxySpec.tolerations }} + tolerations: + {{- toYaml .Values.starrocksFeProxySpec.tolerations | nindent 6 }} + {{- end }} + {{- if .Values.starrocksFeProxySpec.livenessProbeFailureSeconds }} + livenessProbeFailureSeconds: {{ .Values.starrocksFeProxySpec.livenessProbeFailureSeconds }} + {{- end }} + {{- if .Values.starrocksFeProxySpec.readinessProbeFailureSeconds }} + readinessProbeFailureSeconds: {{ .Values.starrocksFeProxySpec.readinessProbeFailureSeconds }} + {{- end }} + {{- if .Values.starrocksFeProxySpec.emptyDirs }} + storageVolumes: + {{- range .Values.starrocksFeProxySpec.emptyDirs }} + - name: {{ .name }} + storageClassName: "emptyDir" + mountPath: {{ .mountPath }} + {{- end }} + {{- end }} + {{- if .Values.starrocksFeProxySpec.podLabels }} + podLabels: + {{- toYaml .Values.starrocksFeProxySpec.podLabels | nindent 6 }} + {{- end }} + {{- end }} diff --git a/charts/starrocks/values.yaml b/charts/starrocks/values.yaml new file mode 100644 index 0000000..2f031d1 --- /dev/null +++ b/charts/starrocks/values.yaml @@ -0,0 +1,1295 @@ +# set the nameOverride values for creating the same resources with the parent chart. +# In version v1.7.1 or before, there is only one chart called kube-starrocks, and the chart name is the prefix +# of some resources created by the chart. +# In version v1.8.0, the kube-starrocks chart is split into two charts, and to keep backward compatibility, the +# nameOverride is used to set the prefix of the resources created by starrocks chart. +nameOverride: "kube-starrocks" + +# This configuration is used to modify the root password during initial deployment. +# After deployment is completed, it won't take effect to modify the password here and to do a `helm upgrade`. +# It also supports providing a secret name that contains a password, using the password in the secret instead of the plaintext in the values.yaml. +# When both password and passwordSecret are set, only passwordSecret takes effect. +# Note: If you install StarRocks using helm install without setting the initPassword, then for the following upgrade deployments, +# you should also not set the initPassword. +# If you install StarRocks using helm install and set the initPassword, please always retain the configuration of initPassword. +initPassword: + enabled: false + # Note: If you are using Argo CD to deploy the StarRocks cluster, you must set isInstall to false after the first installation. + # This is because Argo CD supports Helm like this: helm template | kubectl apply -f -. If isInstall is true, the + # initPassword job will be executed every time you run the command. + # See https://github.com/argoproj/argo-cd/discussions/7496#discussioncomment-1609267 for more information + isInstall: true + password: "" + # The secret name that contains the password, the key of the secret is "password", and you should create it first. + passwordSecret: "" + # The image of the initPassword job, if it is not set, the FE image will be used. + # See https://github.com/StarRocks/starrocks-kubernetes-operator/issues/453 for why we need to set the image. + image: "" + # The annotations for the Job, not including the annotations for the pod. + annotations: {} + # The annotations for the Job's Pod, not including the annotations for the job. + podAnnotations: {} + # resources for init_job pod. + resources: {} + #resources: + # requests: + # cpu: 500m + # memory: 400Mi + # limits: + # cpu: 500m + # memory: 800Mi + +# TimeZone is used to set the environment variable TZ for pod, with Asia/Shanghai as the default. +timeZone: Asia/Shanghai + +# This configuration is used to integrate with an external system DataDog. +# You can enable the integration by setting the enabled to true, e.g., datalog.log.enabled=true will enable datadog agent +# to collect the log. +datadog: + log: + enabled: false + # besides the attributes you added, the chart will append "source" and "service" attributes to the log config. + # see https://docs.datadoghq.com/containers/kubernetes/log/?tab=operator for more details. + logConfig: '{}' # e.g., '{"app": "starrocks", "tags": ["aa", "bb"]}' + metrics: + enabled: false + profiling: + fe: false # change to 'true' to enable profiling on FE pods; + be: false # change to 'true' to enable profiling on BE pods; + cn: false # change to 'true' to enable profiling on CN pods; + env: "starrocks-default" # the default value for DD_ENV; + configMode: "service" # see https://docs.datadoghq.com/containers/cluster_agent/admission_controller/?tab=operator#configure-apm-and-dogstatsd-communication-mode + +# This configuration is used to integrate with the external system Prometheus. +metrics: + serviceMonitor: + # Whether to expose metrics to Prometheus by ServiceMonitor. + # Note: make sure the prometheus operator is installed in your cluster. + # If prometheus is not installed by operator, you can add annotations on k8s service to expose metrics. + # See https://github.com/StarRocks/starrocks-kubernetes-operator/blob/main/doc/integration/integration-prometheus-grafana.md#51-turn-on-the-prometheus-metrics-scrape-by-adding-annotations for more details. + enabled: false + # Prometheus ServiceMonitor labels + labels: {} + # scraper: prometheus-operator + # Prometheus ServiceMonitor interval + interval: 15s + # Whether to enable basic auth + basicAuth: + enabled: false + # The name of the secret that contains the username for basic auth. + # The secret should contain a key named "username". + usernameSecretName: "" + # The key in the secret that contains the username for basic auth. + usernameSecretKey: "" + # The name of the secret that contains the password for basic auth. + # The secret should contain a key named "password". + passwordSecretName: "" + # The key in the secret that contains the password for basic auth. + passwordSecretKey: "" + # Whether to enable request parameters for the ServiceMonitor. + endpointParam: + enabled: false + # the parameters for the ServiceMonitor. + # params: + # with_materialized_view_metrics: + # - "all" + params: {} + +# deploy a starrocks cluster +starrocksCluster: + # the name of starrockscluster cluster, if not set, the value of nameOverride fields will be used. + name: "" + # the namespace of starrockscluster cluster, if not set, the release namespace will be used. + namespace: "" + # annotations for starrocks cluster. + annotations: {} + # specify the BE/CN deployment or not. + enabledBe: true + enabledCn: false + # Disaster recovery configuration. If you want to enable disaster recovery, you need to set the enabled field to true. + # Note: + # 1. If you are using an existing StarRocks cluster, you need to clean up the meta of the FE component and the data of the CN + # component before enabling disaster recovery. So it is better to use an empty StarRocks cluster to start disaster recovery. + # 2. After disaster recovery, Operator will reboot the cluster as a normal cluster automatically, so if you need more checks by yourself, + # you can + # 1. Set the replicas of FE component to 1 + # 2. Set enabledBe and enabledCn to be false to disable to deploy BE and CN components. + # 3. Generation field is used to run multiple times for disaster recovery. For example, if the last disaster recovery is + # not what you want, you can modify related configurations and increase the generation value to run a new disaster recovery. + disasterRecovery: + # enabled: true + # generation: 1 + # componentValues field is used to define values for all starrocks cluster components, including starrocksFESpec, + # starrocksBeSpec, starrocksCnSpec, not including starrocksFeProxySpec. So that you do not need to modify them in + # their own spec. + # Note: + # 1. The values in their own spec will take precedence over the values in this field. + # 2. The values in their own spec will replace all the values in this field, not merge. + componentValues: + image: + tag: "3.5-latest" + # hostAliases allows adding entries to /etc/hosts inside the containers. + hostAliases: [] + # - ip: "127.0.0.1" + # hostnames: + # - "example.com" + # If runAsNonRoot is true, the container is run as a non-root user. + # The userId will be set to 1000, and the groupID will be set to 1000. + # Note: If you have started the container through root, and then FE/BE began to create directories, write files, etc. + # under the mounted directory as root. When you start the container as a non-root user, the container will not + # have permission to access these files. So you'd better set runAsNonRoot to true when you set up the cluster. + runAsNonRoot: false + # schedulerName allows you to specify which scheduler will be used for your pods. + schedulerName: "" + # serviceAccount for access cloud service. + serviceAccount: "" + # imagePullSecrets allows you to use secrets to pull images for pods. + imagePullSecrets: [] + # - name: "image-pull-secret" + # tolerations for pod scheduling to nodes with taints + # Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + tolerations: [] + # - key: "key" + # operator: "Equal|Exists" + # value: "value" + # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" + # topologySpreadConstraints for scheduling pods across failure-domains. + # Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/ + topologySpreadConstraints: [] + # - maxSkew: 1 + # topologyKey: topology.kubernetes.io/zone + # whenUnsatisfiable: DoNotSchedule|ScheduleAnyway + # labelSelector: + # matchLabels: + # foo: bar + # If specified, the pod's nodeSelector,displayName="Map of nodeSelectors to match when scheduling pods on nodes" + # Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector + nodeSelector: {} + # kubernetes.io/arch: amd64 + # kubernetes.io/os: linux + # affinity for pod scheduling. + affinity: {} + # nodeAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # nodeSelectorTerms: + # - matchFields: + # - key: metadata.name + # operator: In + # values: + # - target-host-name + # podAntiAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # - labelSelector: + # matchExpressions: + # - key: app.kubernetes.io/component + # operator: In + # values: + # - fe + # - be + # - cn + # topologyKey: "kubernetes.io/hostname" + # the pod labels for user select or classify pods. + podLabels: {} + +# spec to deploy fe. +starrocksFESpec: + # number of replicas to deploy for a FE statefulset. + replicas: 1 + image: + # image sliced by "repository:tag" + repository: starrocks/fe-ubuntu + tag: "" + imagePullPolicy: IfNotPresent + # Specify the entrypoint for FE. + # By default, the operator will use '/opt/starrocks/fe_entrypoint.sh' as a command and use '$(FE_SERVICE_NAME)' as args in the container spec. + # If the entrypoint is set, the command will be ["bash", "-c"], and the args will be a filename of the entrypoint script. + # A configmap with the name $cluster-fe-entrypoint-script will be created, and the script will be mounted to /etc/starrocks/entrypoint.sh + # Pod will be restarted if the entrypoint script is updated. + entrypoint: {} + # script: | + # #! /bin/bash + # echo "do something before start fe" + # exec /opt/starrocks/fe_entrypoint.sh $FE_SERVICE_NAME + # add annotations for FE pods. For example, if you want to config monitor for datadog, you can config the annotations. + annotations: {} + # If runAsNonRoot is true, the container is run as a non-root user. + # The userId will be set to 1000, and the groupID will be set to 1000. + # Note: If you have started the container through root, and then FE/BE began to create directories, write files, etc. + # under the mounted directory as root. When you start the container as a non-root user, the container will not + # have permission to access these files. So you'd better set runAsNonRoot to true when you set up the cluster. + runAsNonRoot: false + # Whether this container has a read-only root filesystem. + # Note: The FE/BE/CN container should support read-only root filesystem. The newest version of FE/BE/CN is 3.3.6 and does not support read-only root filesystem. + readOnlyRootFilesystem: false + # add/drop capabilities for FE container. + capabilities: {} + # add: + # - PERFMON + # - SYS_PTRACE + # drop: + # - SYS_ADMIN + # set sysctls for FE pod. + # See https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/ for how to set sysctls. + # Note: The use of unsafe sysctls is at-your-own-risk and can lead to severe problems + sysctls: [] + # - name: net.ipv4.ip_unprivileged_port_start + # value: "2048" + # specify the service name and port config and serviceType + # the service type refers https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types + service: + # the FE service type, only supported ClusterIP, NodePort, LoadBalancer + type: "ClusterIP" + # the loadBalancerIP for static ip config when the type=LoadBalancer and loadbalancerIp is not empty. + loadbalancerIP: "" + # add annotations for external FE service. + annotations: {} + # Add labels for external FE service. The operator may add its own default labels. + labels: {} + # Config the service port for FE service. + # To assign a specific port or nodePort to a service, you should specify them by the corresponding name or + # containerPort in the service configuration. If both containerPort and name are specified, containerPort takes precedence. + # For fe, port name can be http, query, rpc, edit-log, and their default container port is 8030, 9030, 9020, 9010. + ports: [] + # e.g., specify a dedicated node port for FE service by containerPort. + # - nodePort: 30030 # The range of valid ports is 30000-32767 + # containerPort: 8030 # The port exported on the container + # specifies the source IP ranges for the load balancer when the type=LoadBalancer. + loadBalancerSourceRanges: [] + # - 10.0.0.0/8 + # imagePullSecrets allows you to use secrets to pull images for pods. + imagePullSecrets: [] + # - name: "image-pull-secret" + # serviceAccount for FE access cloud service. + serviceAccount: "" + # If specified, the pod's nodeSelector,displayName="Map of nodeSelectors to match when scheduling pods on nodes" + # Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector + nodeSelector: {} + # kubernetes.io/arch: amd64 + # kubernetes.io/os: linux + # the pod labels for user select or classify pods. + podLabels: {} + # hostAliases allows adding entries to /etc/hosts inside the containers + hostAliases: [] + # - ip: "127.0.0.1" + # hostnames: + # - "example.com" + # schedulerName allows you to specify which scheduler will be used for your pods. + schedulerName: "" + # Additional FE container environment variables. + # See https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/ for how to define environment variables. + # Note: If you use slice to define environment variables, and if there are multiple values files, the values in the last values file will take effect. + # If you use a map to define environment variables, the values will be merged. + # You can only use one of the manners to define environment variables. + # To avoid the different types of feEnvVars, we do not define the default value of feEnvVars, e.g., feEnvVars: [] or feEnvVars: {}. + #feEnvVars: + # define environment variables by slice. + # E.g., static environment variable: + # - name: DEMO_GREETING + # value: "Hello from the environment" + # e.g., secret environment variable: + # - name: USERNAME + # valueFrom: + # secretKeyRef: + # name: mysecret + # key: username + # affinity for FE pod scheduling. + # Note: It will affect the scheduling of the init-password job. + affinity: {} + # nodeAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # nodeSelectorTerms: + # - matchFields: + # - key: metadata.name + # operator: In + # values: + # - target-host-name + # podAntiAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # - labelSelector: + # matchExpressions: + # - key: app.kubernetes.io/component + # operator: In + # values: + # - fe + # topologyKey: "kubernetes.io/hostname" + # Node tolerations for FE pod scheduling to nodes with taints + # Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + # Note: It will affect the scheduling of the init-password job. + tolerations: [] + # - key: "key" + # operator: "Equal|Exists" + # value: "value" + # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" + # topologySpreadConstraints for scheduling pods across failure-domains. + # Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/ + topologySpreadConstraints: [] + # - maxSkew: 1 + # topologyKey: topology.kubernetes.io/zone + # whenUnsatisfiable: DoNotSchedule|ScheduleAnyway + # labelSelector: + # matchLabels: + # foo: bar + # resources for FE pod. + resources: + requests: + cpu: 4 + memory: 4Gi + # If you want to remove one resource limit, e.g., cpu, you can set it to cpu: "unlimited". + limits: + cpu: 8 + memory: 8Gi + # FE storageSpec for persistent metadata. + # Note: Once set, the following fields will not be allowed to be modified. + storageSpec: + # Specifies the name prefix of the volumes to mount. If left unspecified, + # `emptyDir` volumes will be used by default, which are ephemeral and data + # will be lost on pod restart. + # + # For persistent storage, specify a volume name prefix. + # For example, using `fe` as the name prefix would be appropriate. + # Note: If the values of the following mountPaths are not default, you must set the name to fe. + name: "" + # The storageClassName represent the used storageclass name. If not set will use k8s cluster default storageclass. + # You must set a name when you set storageClassName. + # Note: Because hostPath field is not supported here, hostPath is not allowed to be set in storageClassName. + storageClassName: "" + # the persistent volume size for data. + # FE container stops running if the disk-free space which the FE meta-directory residents is less than 5Gi. + storageSize: 10Gi + # If storageMountPath is empty, the storageMountPath will be set to /opt/starrocks/fe/meta. + storageMountPath: "" + # If not set will use the value of the storageClassName field. + logStorageClassName: "" + # Setting this parameter can persist log storage, and the mount path is /opt/starrocks/fe/log. + # If you set it to 0Gi, the related PVC will not be created, and the log will not be persisted. + logStorageSize: 5Gi + # If logMountPath is empty, the logMountPath will be set to /opt/starrocks/fe/log. + # If logMountPath is not /opt/starrocks/fe/log, you must add in config the following configuration: + # dump_log_dir = xxx + # sys_log_dir = xxx + # audit_log_dir = xxx + logMountPath: "" + # mount emptyDir volumes if necessary. + # Note: please use storageSpec field for persistent metadata and log. + emptyDirs: [] + # e.g., mount an emptyDir volume to /tmp + # - name: tmp-data + # mountPath: /tmp + # mount hostPath volumes if necessary. + # Note: please use storageSpec field for persistent storage data and log. + hostPaths: [] + # e.g., mount a hostPath volume to /tmp + # - name: tmp-data + # hostPath: + # path: /tmp + # type: Directory + # mountPath: /tmp + # persistentVolumeClaimRetentionPolicy specifies the retention policy for PersistentVolumeClaims associated with the component. + # The whenDeleted field is supported for all components, and it determines whether to delete PVCs when the StatefulSet is deleted. + # The whenScaled field is only supported for the CN component. + persistentVolumeClaimRetentionPolicy: + # whenDeleted: Delete + # the config for start fe. the base information as follows. + config: | + LOG_DIR = ${STARROCKS_HOME}/log + DATE = "$(date +%Y%m%d-%H%M%S)" + JAVA_OPTS="-Dlog4j2.formatMsgNoLookups=true -Xmx8192m -XX:+UseG1GC -Xlog:gc*:${LOG_DIR}/fe.gc.log.$DATE:time" + http_port = 8030 + rpc_port = 9020 + query_port = 9030 + edit_log_port = 9010 + mysql_service_nio_enabled = true + sys_log_level = INFO + # When shutting down FE, it will wait for min_graceful_exit_time_second seconds before refusing new requests. If you + # want to ensure that queries, writes, and other operations complete smoothly, you need to ensure that the time it + # takes for the Pod to become Not Ready is less than min_graceful_exit_time_second. The default Pod configuration is + # probe.FailureThreshold = 3, probe.PeriodSeconds = 5, so in the worst case, the Pod will have (3+1)*5 = 20s to + # transition to Node Not Ready state. Since the default value of min_graceful_exit_time_second is 15, we change it to a larger value. + # Note: StarRocks version must be greater than or equal to 3.4.2 to support this configuration, otherwise it will not take effect. + min_graceful_exit_time_second = 25 + # A map object for setting the FE config. When configyaml is set to non-empty, the configs in configyaml will take + # precedence and values in the config field will be discarded. + # Note: When using configyaml, the number needs to be quoted to avoid being converted to scientific notation. + # E.g., brpc_socket_max_unwritten_bytes: "10737418240" + configyaml: {} + # mount secrets if necessary. + # see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath. + secrets: [] + # e.g., mount my-secret to /etc/my-secret + # - name: my-secret + # mountPath: /etc/my-secret + # subPath: "" + # mount configmaps if necessary. + # see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath. + configMaps: [] + # e.g., mount my-configmap to /etc/my-configmap + # - name: my-configmap + # mountPath: /etc/my-configmap + # subPath: "" + # terminationGracePeriodSeconds defines duration in seconds the FE pod needs to terminate gracefully. + # the default value is 120 seconds + terminationGracePeriodSeconds: 120 + + # Please upgrade the CRD with v1.8.7 released version if you want to use the following configuration. + # including: startupProbeFailureSeconds, livenessProbeFailureSeconds, readinessProbeFailureSeconds + + # StartupProbeFailureSeconds defines the total failure seconds of a startup Probe. + # the default value is 300 seconds + # You can set it to "0" to disable the probe. + startupProbeFailureSeconds: + # LivenessProbeFailureSeconds defines the total failure seconds of a liveness Probe. + # the default value is 15 seconds + # You can set it to "0" to disable the probe. + livenessProbeFailureSeconds: + # ReadinessProbeFailureSeconds defines the total failure seconds of a readiness Probe. + # the default value is 15 seconds + # You can set it to "0" to disable the probe. + readinessProbeFailureSeconds: + # Lifecycle describes actions that the management system should take in response to container lifecycle events. + # By default, Operator will add corresponding preStop hooks for different components. For example, the preStop + # script for the FE Component is /opt/starrocks/fe_prestop.sh, for the BE Component is /opt/starrocks/be_prestop.sh, + # and for the CN Component is /opt/starrocks/cn_prestop.sh. + # You can set postStart hook. + lifecycle: {} + # postStart: + # exec: + # command: + # - /bin/sh + # - -c + # - echo "Hello, world!" + # Sidecars is an optional list of containers that are run in the same pod as the starrocks component. + # You can use this field to launch helper containers that provide additional functionality to the main container. + # See https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#Container for how to define sidecars. + sidecars: [] + # - name: sidecar-container + # image: busybox + # # If starrocksFESpec.storageSpec.name is FE or not set, you can mount the volume of meta like this. + # command: ['sh', '-c', 'echo "hello from the sidecar container" >/opt/starrocks/fe/meta/sidecar-data.txt && sleep 3600'] + # volumeMounts: + # - mountPath: /opt/starrocks/fe/meta + # name: fe-meta # append '-meta' to the end of the name of the starrocksFESpec.storageSpec.name + # sidecarsMap is an optional map of containers that are run in the same pod as the starrocks component. + # The reason for using sidecarsMap please refer to https://github.com/StarRocks/starrocks-kubernetes-operator/issues/618 + # sidecarsMap has higher priority than sidecars, and the key of sidecarsMap is the name of the sidecar container. + sidecarsMap: {} + # sidecar-container: + # image: busybox + # # If starrocksFESpec.storageSpec.name is FE or not set, you can mount the volume of meta like this. + # command: ['sh', '-c', 'echo "hello from the sidecar container" >/opt/starrocks/fe/meta/sidecar-data.txt && sleep 3600'] + # volumeMounts: + # - mountPath: /opt/starrocks/fe/meta + # name: fe-meta # append '-meta' to the end of the name of the starrocksFESpec.storageSpec.name + # initContainers is an optional list of containers that are run in the same pod as the starrocks component. + # You can use this to launch helper containers that run before the main container starts. + # See https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#Container for how to configure a container. + initContainers: [] + # - name: init-container + # image: busybox + # # If starrocksFESpec.storageSpec.name is FE or not set, you can mount the volume of meta like this. + # command: ['sh', '-c', 'echo "hello from the init container" >/opt/starrocks/fe/meta/init-data.txt'] + # volumeMounts: + # - mountPath: /opt/starrocks/fe/meta + # name: fe-meta # append '-meta' to the end of the starrocksFESpec.storageSpec.name + # Max unavailable pods for the FE component when doing rolling update. + # This field cannot be 0. The default setting is 1. + # Note: Because Operator uses statefulset to manage this component, the maxUnavailable field is in Alpha stage, and it is honored + # only by API servers that are running with the MaxUnavailableStatefulSet feature gate enabled. + # See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#maximum-unavailable-pods for more details. + maxUnavailablePods: + # Share a single process namespace between all the containers in a pod. + # When this is set, containers will be able to view and signal processes from other containers + # in the same pod, and the first process in each container will not be assigned PID 1. + shareProcessNamespace: + +# spec for compute node, compute node provide compute function. +starrocksCnSpec: + # Number of replicas to deploy for the CN component. + # + # When autoscaling of the CN statefulset is used, the `replicas` field is set to null + # by the operator, and autoscaling is controlled by Horizontal Pod Autoscaling (HPA). + # You should only uncomment and set the `replicas` field if autoscaling is disabled. + # replicas: 1 + image: + # image sliced by "repository:tag" + repository: starrocks/cn-ubuntu + tag: "" + imagePullPolicy: IfNotPresent + # Specify the entrypoint for CN. + # By default, the operator will use '/opt/starrocks/cn_entrypoint.sh' as command, and use '$(FE_SERVICE_NAME)' as args in container spec. + # If the entrypoint is set, the command will be ["bash", "-c"], and the args will be a filename of the entrypoint script. + # A configmap with the name $cluster-cn-entrypoint-script will be created, and the script will be mounted to /etc/starrocks/entrypoint.sh + # Pod will be restarted if the entrypoint script is updated. + entrypoint: {} + # script: | + # #! /bin/bash + # echo "do something before start cn" + # exec /opt/starrocks/cn_entrypoint.sh $FE_SERVICE_NAME + # serviceAccount for CN access cloud service. + serviceAccount: "" + # add annotations for CN pods. for example, if you want to config monitor for datadog, you can config the annotations. + annotations: {} + # If runAsNonRoot is true, the container is run as a non-root user. + # The userId will be set to 1000, and the groupID will be set to 1000. + # Note: If you have started the container through root, and then FE/BE began to create directories, write files, etc. + # under the mounted directory as root. When you start the container as a non-root user, the container will not + # have permission to access these files. So you'd better set runAsNonRoot to true when you set up the cluster. + runAsNonRoot: false + # Whether this container has a read-only root filesystem. + # Note: The FE/BE/CN container should support read-only root filesystem. The newest version of FE/BE/CN is 3.3.6 and does not support read-only root filesystem. + readOnlyRootFilesystem: false + # add/drop capabilities for CN container. + capabilities: {} + # add: + # - PERFMON + # - SYS_PTRACE + # drop: + # - SYS_ADMIN + # set sysctls for CN pod. + # See https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/ for how to set sysctls. + # Note: The use of unsafe sysctls is at-your-own-risk and can lead to severe problems + sysctls: [] + # - name: net.ipv4.ip_unprivileged_port_start + # value: "2048" + # specify the service name and port config and serviceType + # the service type refers https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types + service: + # the CN service type, only supported ClusterIP, NodePort, LoadBalancer + type: "ClusterIP" + # the loadBalancerIP for static ip config when the type=LoadBalancer and loadBalancerIp is not empty. + loadbalancerIP: "" + # add annotations for external CN service. + annotations: {} + # Add labels for external CN service. The operator may add its own default labels. + labels: {} + # Config the service port for CN service. + # To assign a specific port or nodePort to a service, you should specify them by the corresponding name or + # containerPort in the service configuration. If both containerPort and name are specified, containerPort takes precedence. + # For cn, the port name can be webserver, heartbeat, brpc, thrift, and their default container port is 8040, 9050, 8060, 9060. + ports: [] + # e.g., specify a dedicated node port for CN service by containerPort. + # - nodePort: 30040 # The range of valid ports is 30000-32767 + # containerPort: 8040 # The port on the container to expose. + # Specify the source IP ranges for the load balancer when the type=LoadBalancer. + loadBalancerSourceRanges: [] + # - 10.0.0.0/8 + # imagePullSecrets allows you to use secrets for pulling images for your pods. + imagePullSecrets: [] + # - name: "image-pull-secret" + # If specified, the pod's nodeSelector,displayName="Map of nodeSelectors to match when scheduling pods on nodes" + # Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector + nodeSelector: {} + # kubernetes.io/arch: amd64 + # kubernetes.io/os: linux + # the pod labels for user select or classify pods. + podLabels: {} + ## hostAliases allows adding entries to /etc/hosts inside the containers + hostAliases: [] + # - ip: "127.0.0.1" + # hostnames: + # - "example.com" + # schedulerName allows you to specify which scheduler will be used for the pod + schedulerName: "" + # CN container environment variables. + # See https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/ for how to define environment variables. + # Note: If you use slice to define environment variables, and if there are multiple values files, the values in the last values file will take effect. + # If you use a map to define environment variables, the values will be merged. + # You can only use one of the manners to define environment variables. + # To avoid a different type of cnEnvVars, we do not define the default value of cnEnvVars, e.g., cnEnvVars: [] or cnEnvVars: {}. + # cnEnvVars: + # define environment variables by slice. + # E.g., static environment variable: + # - name: DEMO_GREETING + # value: "Hello from the environment" + # e.g., secret environment variable: + # - name: USERNAME + # valueFrom: + # secretKeyRef: + # name: mysecret + # key: username + # affinity for CN pod scheduling. + affinity: {} + # nodeAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # nodeSelectorTerms: + # - matchFields: + # - key: metadata.name + # operator: In + # values: + # - target-host-name + # podAntiAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # - labelSelector: + # matchExpressions: + # - key: app.kubernetes.io/component + # operator: In + # values: + # - cn + # topologyKey: "kubernetes.io/hostname" + # Node tolerations for CN pod scheduling to nodes with taints + # Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + tolerations: [] + # - key: "key" + # operator: "Equal|Exists" + # value: "value" + # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" + # topologySpreadConstraints for scheduling pods across failure-domains. + # Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/ + topologySpreadConstraints: [] + # - maxSkew: 1 + # topologyKey: topology.kubernetes.io/zone + # whenUnsatisfiable: DoNotSchedule|ScheduleAnyway + # labelSelector: + # matchLabels: + # foo: bar + autoScalingPolicy: {} + # you can select different versions of HPA (Horizontal Pod Autoscaler) based on the Kubernetes version you are + # using to ensure compatibility and adaptability. the default version is v2beta2. + # version: v2beta2 + # maxReplicas: 10 + # minReplicas: 1 + # hpaPolicy: + # metrics: + # - type: Resource + # resource: + # name: memory + # target: + # averageUtilization: 30 + # type: Utilization + # - type: Resource + # resource: + # name: cpu + # target: + # averageUtilization: 30 + # type: Utilization + # behavior: + # scaleUp: + # policies: + # - type: Pods + # value: 1 + # periodSeconds: 10 + # scaleDown: + # selectPolicy: Disabled + # define resources requests and limits for CN pods. + resources: + requests: + cpu: 4 + memory: 8Gi + # If you want to remove one resource limit, e.g., cpu, you can set it to cpu: "unlimited". + limits: + cpu: 8 + memory: 8Gi + # specify a storageclass name and request size. + # Note: Once set, the following fields will not be allowed to be modified. + storageSpec: + # Specifies the name prefix of the volumes to mount. If left unspecified, + # `emptyDir` volumes will be used, which are ephemeral, and only for log. + # The logs will be lost on pod restart when using emptyDir volumes. + # + # For persistent storage, specify a volume name prefix. + # For example, using `cn` as the name prefix would BE appropriate. + # Note: If the values of the following mountPaths are not default, you must set the name to cn. + name: "" + # The storageClassName represent the used storageclass name. If not set will use k8s cluster default storageclass. + # You must set a name when you set storageClassName + # Note: Because hostPath field is not supported here, hostPath is not allowed to be set in storageClassName. + storageClassName: "" + # the storage size of per persistent volume for data. + storageSize: 1Ti + # The number of persistent volumes for data. + # If storageCount == 1, + # the storageMountPath field is used to specify the mount path of the persistent volume. If storageMountPath is empty, + # the storageMountPath will be set to /opt/starrocks/cn/storage. + # If storageMountPath is not /opt/starrocks/cn/storage, you must add in config the following configuration: storage_root_path = xxx. + # If storageCount > 1, + # the storageMountPath field is used to specify the prefix of the mount path for the persistent volume. For example, if the + # storageMountPath is /opt/starrocks/cn/storage, the real mount path will be /opt/starrocks/cn/storage0, /opt/starrocks/cn/storage1, ... + # You must add in config the following configuration: storage_root_path = /opt/starrocks/cn/storage0;/opt/starrocks/cn/storage1;... + storageCount: 1 + # see the comment of storageCount for the usage of storageMountPath. + storageMountPath: "" + # If not set will use the value of the storageClassName field. + logStorageClassName: "" + # The storage size of persistent volume for log, and the mount path is /opt/starrocks/cn/log. + # If you set it to 0Gi, the related PVC will not be created, and the log will not be persisted. + logStorageSize: 20Gi + # If logMountPath is empty, the logMountPath will be set to /opt/starrocks/cn/log. + # If logMountPath is not /opt/starrocks/cn/log, you must add in config the following configuration: sys_log_dir = xxx. + logMountPath: "" + # If not set will use the value of the storageClassName field. + spillStorageClassName: "" + # Setting this parameter can persist spill storage, and the mount path is /opt/starrocks/cn/spill. + # If you set it to 0Gi, the related PVC will not be created, and the spill will not be persisted. + # You need to add spill_local_storage_dir=/opt/starrocks/cn/spill in cn.conf. + spillStorageSize: 0Gi + # If spillMountPath is empty, the spillMountPath will be set to /opt/starrocks/cn/spill. + # If spillMountPath is not /opt/starrocks/cn/spill, you must add in config the following configuration: spill_local_storage_dir = xxx. + spillMountPath: "" + # mount emptyDir volumes if necessary. + # Note: please use storageSpec field for persistent storage data and log. + emptyDirs: [] + # e.g., mount an emptyDir volume to /tmp + # - name: tmp-data + # mountPath: /tmp + # mount hostPath volumes if necessary. + # Note: + # 1. Please use the storageSpec field for persistent storage data and log. + # 2. Please use podAntiAffinity to avoid the pods are scheduled on the same node. + # 3. If you use hostPath to mount the volume of cache data, the cache will be lost when the pod is restarted. + hostPaths: [] + # e.g., mount a hostPath volume to /tmp + # - name: tmp-data + # hostPath: + # path: /tmp + # type: Directory + # mountPath: /tmp + # persistentVolumeClaimRetentionPolicy specifies the retention policy for PersistentVolumeClaims associated with the component. + # The whenDeleted field is supported for all components, and it determines whether to delete PVCs when the StatefulSet is deleted. + # The whenScaled field is only supported for the CN component. + persistentVolumeClaimRetentionPolicy: + # whenDeleted: Delete + # whenScaled: Delete + # the config start for cn, the base information as follows. + # From StarRocks 3.1, the official documentation uses: + # 1. be_port instead of thrift_port, but the thrift_port is still supported. + # 2. be_http_port instead of webserver_port, but the webserver_port is still supported. + # To avoid the impact of the change on the user's deployment, we still use the old configuration. + config: | + sys_log_level = INFO + # ports for admin, web, heartbeat service + thrift_port = 9060 + webserver_port = 8040 + heartbeat_service_port = 9050 + brpc_port = 8060 + # A map object for setting the config. When configyaml is set, to non-empty, the configs in configyaml will take + # precedence and values in the config field will be discarded. + # Note: When using configyaml, the number needs to be quoted to avoid being converted to scientific notation. + # E.g., brpc_socket_max_unwritten_bytes: "10737418240" + configyaml: {} + # mount secrets if necessary. + # see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath. + secrets: [] + # e.g., mount my-secret to /etc/my-secret + # - name: my-secret + # mountPath: /etc/my-secret + # subPath: "" + # mount configmaps if necessary. + # see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath. + configMaps: [] + # e.g., mount my-configmap to /etc/my-configmap + # - name: my-configmap + # mountPath: /etc/my-configmap + # subPath: "" + # terminationGracePeriodSeconds defines duration in seconds the CN pod needs to terminate gracefully. + # the default value is 120 seconds + terminationGracePeriodSeconds: 120 + + # Please upgrade the CRD with v1.8.7 released version if you want to use the following configuration. + # including: startupProbeFailureSeconds, livenessProbeFailureSeconds, readinessProbeFailureSeconds + + # StartupProbeFailureSeconds defines the total failure seconds of a startup Probe. + # the default value is 300 seconds + # You can set it to "0" to disable the probe. + startupProbeFailureSeconds: + # LivenessProbeFailureSeconds defines the total failure seconds of liveness Probe. + # the default value is 15 seconds + # You can set it to "0" to disable the probe. + livenessProbeFailureSeconds: + # ReadinessProbeFailureSeconds defines the total failure seconds of a readiness Probe. + # the default value is 15 seconds + # You can set it to "0" to disable the probe. + readinessProbeFailureSeconds: + # Lifecycle describes actions that the management system should take in response to container lifecycle events. + # By default, Operator will add corresponding preStop hooks for different components. For example, the preStop + # script for the FE Component is /opt/starrocks/fe_prestop.sh, for the BE Component is /opt/starrocks/be_prestop.sh, + # and for the CN Component is /opt/starrocks/cn_prestop.sh. + # You can set postStart hook. + lifecycle: {} + # postStart: + # exec: + # command: + # - /bin/sh + # - -c + # - echo "Hello, world!" + # Sidecars is an optional list of containers that are run in the same pod as the starrocks component. + # You can use this field to launch helper containers that provide additional functionality to the main container. + # See https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#Container for how to configure a container. + sidecars: [] + # - name: sidecar-container + # image: busybox + # # If starrocksCnSpec.storageSpec.name is cn, you can mount the volume of cache data like this. + # # If starrocksCnSpec.storageSpec.name is not set, no default volume will be created, so you cannot mount the volume of cache data like this. + # command: ['sh', '-c', 'echo "hello from the sidecar container" >/opt/starrocks/cn/storage/sidecar-data.txt && sleep 3600'] + # volumeMounts: + # - mountPath: /opt/starrocks/cn/storage + # name: cn-data # append '-data' to the end of the name of the starrocksCnSpec.storageSpec.name + # sidecarsMap is an optional map of containers that are run in the same pod as the starrocks component. + # The reason for using sidecarsMap please refer to https://github.com/StarRocks/starrocks-kubernetes-operator/issues/618 + # sidecarsMap has higher priority than sidecars, and the key of sidecarsMap is the name of the sidecar container. + sidecarsMap: {} + # sidecar-container: + # image: busybox + # # If starrocksCnSpec.storageSpec.name is cn, you can mount the volume of cache data like this. + # # If starrocksCnSpec.storageSpec.name is not set, no default volume will be created, so you cannot mount the volume of cache data like this. + # command: ['sh', '-c', 'echo "hello from the sidecar container" >/opt/starrocks/cn/storage/sidecar-data.txt && sleep 3600'] + # volumeMounts: + # - mountPath: /opt/starrocks/cn/storage + # name: cn-data # append '-data' to the end of the name of the starrocksCnSpec.storageSpec.name + # initContainers is an optional list of containers that are run in the same pod as the starrocks component. + # You can use this to launch helper containers that run before the main container starts. + # See https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#Container for how to configure a container. + initContainers: [] + # - name: init-container + # image: busybox + # # If starrocksCnSpec.storageSpec.name is cn, you can mount the volume of cache data like this. + # # If starrocksCnSpec.storageSpec.name is not set, no default volume will be created, so you cannot mount the volume of cache data like this. + # command: ['sh', '-c', 'echo "hello from the init container" >/opt/starrocks/cn/storage/init-data.txt'] + # volumeMounts: + # - mountPath: /opt/starrocks/cn/storage + # name: cn-data # append '-data' to the end of the starrocksCnSpec.storageSpec.name + # Max unavailable pods for the CN component when doing rolling update. + # This field cannot be 0. The default setting is 1. + # Note: Because Operator uses statefulset to manage this component, the maxUnavailable field is in Alpha stage, and it is honored + # only by API servers that are running with the MaxUnavailableStatefulSet feature gate enabled. + # See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#maximum-unavailable-pods for more details. + maxUnavailablePods: + # Share a single process namespace between all of the containers in a pod. + # When this is set, containers will be able to view and signal processes from other containers + # in the same pod, and the first process in each container will not be assigned PID 1. + shareProcessNamespace: + +# spec for component be, provide storage and compute function. +starrocksBeSpec: + # number of replicas to deploy. + replicas: 1 + image: + # image sliced by "repository:tag" + repository: starrocks/be-ubuntu + tag: "" + imagePullPolicy: IfNotPresent + # Specify the entrypoint for BE. + # By default, the operator will use '/opt/starrocks/be_entrypoint.sh' as command, and use '$(FE_SERVICE_NAME)' as args in the container spec. + # If the entrypoint is set, the command will be ["bash", "-c"], and the args will be a filename of the entrypoint script. + # A configmap with the name $cluster-be-entrypoint-script will be created, and the script will be mounted to /etc/starrocks/entrypoint.sh + # Pod will be restarted if the entrypoint script is updated. + entrypoint: {} + # script: | + # #! /bin/bash + # echo "do something before start BE" + # exec /opt/starrocks/be_entrypoint.sh $FE_SERVICE_NAME + # serviceAccount for BE access cloud service. + serviceAccount: "" + # add annotations for BE pods. for example, if you want to config monitor for datadog, you can config the annotations. + annotations: {} + # If runAsNonRoot is true, the container is run as a non-root user. + # The userId will be set to 1000, and the groupID will be set to 1000. + # Note: If you have started the container through root, and then FE/BE began to create directories, write files, etc. + # under the mounted directory as root. When you start the container as a non-root user, the container will not + # have permission to access these files. So you'd better set runAsNonRoot to true when you set up the cluster. + runAsNonRoot: false + # Whether this container has a read-only root filesystem. + # Note: The FE/BE/CN container should support read-only root filesystem. The newest version of FE/BE/CN is 3.3.6 and does not support read-only root filesystem. + readOnlyRootFilesystem: false + # add/drop capabilities for BE container. + capabilities: {} + # add: + # - PERFMON + # - SYS_PTRACE + # drop: + # - SYS_ADMIN + # set sysctls for BE pod. + # See https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/ for how to set sysctls. + # Note: The use of unsafe sysctls is at-your-own-risk and can lead to severe problems + sysctls: [] + # - name: net.ipv4.ip_unprivileged_port_start + # value: "2048" + # specify the service name and port config and serviceType + # the service type refers https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types + service: + # the BE service type only supported ClusterIP, NodePort, LoadBalancer + type: "ClusterIP" + # the loadBalancerIP for static ip config when the type=LoadBalancer and loadbalancerIp is not empty. + loadbalancerIP: "" + # add annotations for external BE service. + annotations: {} + # Add labels for external BE service. The operator may add its own default labels. + labels: {} + # Config the service port for BE service. + # To assign a specific port or nodePort to a service, you should specify them by the corresponding name or + # containerPort in the service configuration. If both containerPort and name are specified, containerPort takes precedence. + # For BE, the port name can be webserver, heartbeat, brpc, be, and their default container port is 8040, 9050, 8060, 9060. + ports: [] + # e.g., specify a dedicated node port for BE service by containerPort. + # - nodePort: 30040 # The range of valid ports is 30000-32767 + # containerPort: 8040 # The port on the container to expose. + # Specify the source IP ranges for the load balancer when the type=LoadBalancer. + loadBalancerSourceRanges: [] + # - 10.0.0.0/8 + # imagePullSecrets allows you to use secrets to pull images for pods. + imagePullSecrets: [] + # - name: "image-pull-secret" + # If specified, the pod's nodeSelector,displayName="Map of nodeSelectors to match when scheduling pods on nodes" + # Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector + nodeSelector: {} + # kubernetes.io/arch: amd64 + # kubernetes.io/os: linux + # the pod labels for user select or classify pods. + podLabels: {} + ## hostAliases allows adding entries to /etc/hosts inside the containers + hostAliases: [] + # - ip: "127.0.0.1" + # hostnames: + # - "example.com" + # schedulerName allows you to specify which scheduler will be used for the pod + schedulerName: "" + # BE container environment variables. + # See https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/ for how to define environment variables. + # Note: If you use slice to define environment variables, and if there are multiple values files, the values in the last values file will take effect. + # If you use a map to define environment variables, the values will be merged. + # You can only use one of the manners to define environment variables. + # To avoid the different type of beEnvVars, we do not define the default value of beEnvVars, e.g., beEnvVars: [] or beEnvVars: {}. + # beEnvVars: + # define environment variables by slice. + # E.g., static environment variable: + # - name: DEMO_GREETING + # value: "Hello from the environment" + # e.g., secret environment variable: + # - name: USERNAME + # valueFrom: + # secretKeyRef: + # name: mysecret + # key: username + # affinity for BE pod scheduling. + affinity: {} + # nodeAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # nodeSelectorTerms: + # - matchFields: + # - key: metadata.name + # operator: In + # values: + # - target-host-name + # podAntiAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # - labelSelector: + # matchExpressions: + # - key: app.kubernetes.io/component + # operator: In + # values: + # - be + # topologyKey: "kubernetes.io/hostname" + # Node tolerations for BE pod scheduling to nodes with taints + # Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + tolerations: [] + # - key: "key" + # operator: "Equal|Exists" + # value: "value" + # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" + # topologySpreadConstraints for scheduling pods across failure-domains. + # Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/ + topologySpreadConstraints: [] + # - maxSkew: 1 + # topologyKey: topology.kubernetes.io/zone + # whenUnsatisfiable: DoNotSchedule|ScheduleAnyway + # labelSelector: + # matchLabels: + # foo: bar + # resources for BE pod. + resources: + requests: + cpu: 4 + memory: 4Gi + # If you want to remove one resource limit, e.g., cpu, you can set it to cpu: "unlimited". + limits: + cpu: 8 + memory: 8Gi + # BE storageSpec for persistent storage. + # Note: Once set, the following fields will not be allowed to be modified. + storageSpec: + # Specifies the name prefix of the volumes to mount. If left unspecified, + # `emptyDir` volumes will be used by default, which are ephemeral and data + # will be lost on pod restart. + # + # For persistent storage, specify a volume name prefix. + # For example, using `be` as the name prefix would be appropriate. + # Note: If the values of the following mountPaths are not default, you must set the name to be. + name: "" + # The storageClassName represent the used storageclass name. If not set will use k8s cluster default storageclass. + # You must set a name when you set storageClassName + # Note: Because hostPath field is not supported here, hostPath is not allowed to be set in storageClassName. + storageClassName: "" + # the storage size of per persistent volume for data. + storageSize: 1Ti + # The number of persistent volumes for data. + # If storageCount == 1, + # the storageMountPath field is used to specify the mount path of the persistent volume. If storageMountPath is empty, + # the storageMountPath will be set to /opt/starrocks/be/storage. + # If storageMountPath /opt/starrocks/be/storage, you must add in config the following configuration: storage_root_path = xxx. + # If storageCount > 1, + # the storageMountPath field is used to specify the prefix of a mount path for the persistent volume. For example, if the + # storageMountPath is /opt/starrocks/be/storage, the real mount path will be /opt/starrocks/be/storage0, /opt/starrocks/be/storage1, ... + # You must add in config the following configuration: storage_root_path = /opt/starrocks/be/storage0;/opt/starrocks/be/storage1;... + storageCount: 1 + # see the comment of storageCount for the usage of storageMountPath. + storageMountPath: "" + # If not set will use the value of the storageClassName field. + logStorageClassName: "" + # Setting this parameter can persist log storage, and the mount path is /opt/starrocks/be/log. + # If you set it to 0Gi, the related PVC will not be created, and the log will not be persisted. + logStorageSize: 20Gi + # If logMountPath is empty, the logMountPath will be set to /opt/starrocks/be/log. + # If logMountPath is not /opt/starrocks/be/log, you must add in config the following configuration: sys_log_dir = xxx. + logMountPath: "" + # If not set will use the value of the storageClassName field. + spillStorageClassName: "" + # Setting this parameter can persist spill storage, and the mount path is /opt/starrocks/be/spill. + # If you set it to 0Gi, the related PVC will not be created, and the spill will not be persisted. + # You need to add spill_local_storage_dir=/opt/starrocks/be/spill in be.conf. + spillStorageSize: 0Gi + # If spillMountPath is empty, the spillMountPath will be set to /opt/starrocks/be/spill. + # If spillMountPath is not /opt/starrocks/be/spill, you must add in config the following configuration: spill_local_storage_dir = xxx. + spillMountPath: "" + # mount emptyDir volumes if necessary. + # Note: please use storageSpec field for persistent storage data and log. + emptyDirs: [] + # e.g., mount an emptyDir volume to /tmp + # - name: tmp-data + # mountPath: /tmp + # mount hostPath volumes if necessary. + # Note: please use storageSpec field for persistent storage data and log. + hostPaths: [] + # e.g., mount a hostPath volume to /tmp + # - name: tmp-data + # hostPath: + # path: /tmp + # type: Directory + # mountPath: /tmp + # persistentVolumeClaimRetentionPolicy specifies the retention policy for PersistentVolumeClaims associated with the component. + # The whenDeleted field is supported for all components, and it determines whether to delete PVCs when the StatefulSet is deleted. + # The whenScaled field is only supported for the CN component. + persistentVolumeClaimRetentionPolicy: + # whenDeleted: Delete + # the config for start be. The base information is as follows. + # From StarRocks 3.1, the official documentation uses: + # 1. be_http_port instead of webserver_port, but the webserver_port is still supported. + # To avoid the impact of the change on the user's deployment, we still use the old configuration. + config: | + be_port = 9060 + webserver_port = 8040 + heartbeat_service_port = 9050 + brpc_port = 8060 + sys_log_level = INFO + default_rowset_type = beta + # A map object for setting the config. When configyaml is set, to non-empty, the configs in configyaml will take + # precedence and values in the config field will be discarded. + # Note: When using configyaml, the number needs to be quoted to avoid being converted to scientific notation. + # E.g., brpc_socket_max_unwritten_bytes: "10737418240" + configyaml: {} + # mount secrets if necessary. + # see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath. + secrets: [] + # e.g., mount my-secret to /etc/my-secret + # - name: my-secret + # mountPath: /etc/my-secret + # subPath: "" + # mount configmaps if necessary. + # see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath. + configMaps: [] + # e.g., mount my-configmap to /etc/my-configmap + # - name: my-configmap + # mountPath: /etc/my-configmap + # subPath: "" + # terminationGracePeriodSeconds defines duration in seconds the BE pod needs to terminate gracefully. + # the default value is 120 seconds + terminationGracePeriodSeconds: 120 + + # Please upgrade the CRD with v1.8.7 released version if you want to use the following configuration. + # including: startupProbeFailureSeconds, livenessProbeFailureSeconds, readinessProbeFailureSeconds + + # StartupProbeFailureSeconds defines the total failure seconds of a startup Probe. + # the default value is 300 seconds + # You can set it to "0" to disable the probe. + startupProbeFailureSeconds: + # LivenessProbeFailureSeconds defines the total failure seconds of liveness Probe. + # the default value is 15 seconds + # You can set it to "0" to disable the probe. + livenessProbeFailureSeconds: + # ReadinessProbeFailureSeconds defines the total failure seconds of a readiness Probe. + # the default value is 15 seconds + # You can set it to "0" to disable the probe. + readinessProbeFailureSeconds: + # Lifecycle describes actions that the management system should take in response to container lifecycle events. + # By default, Operator will add corresponding preStop hooks for different components. For example, the preStop + # script for the FE Component is /opt/starrocks/fe_prestop.sh, for the BE Component is /opt/starrocks/be_prestop.sh, + # and for the CN Component is /opt/starrocks/cn_prestop.sh. + # You can set postStart hook. + lifecycle: {} + # postStart: + # exec: + # command: + # - /bin/sh + # - -c + # - echo "Hello, world!" + # Sidecars is an optional list of containers that are run in the same pod as the starrocks component. + # You can use this field to launch helper containers that provide additional functionality to the main container. + # See https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#Container for how to define sidecars. + sidecars: [] + # - name: sidecar-container + # image: busybox + # # If your starrocksBeSpec.storageSpec.name is 'be' or not set, you can mount the volume of data like this. + # command: ['sh', '-c', 'echo "hello from the sidecar container" >/opt/starrocks/be/storage/sidecar-data.txt && sleep 3600'] + # volumeMounts: + # - mountPath: /opt/starrocks/be/storage + # name: be-data # append '-data' to the end of the name of the starrocksBeSpec.storageSpec.name + # sidecarsMap is an optional map of containers that are run in the same pod as the starrocks component. + # The reason for using sidecarsMap please refer to https://github.com/StarRocks/starrocks-kubernetes-operator/issues/618 + # sidecarsMap has higher priority than sidecars, and the key of sidecarsMap is the name of the sidecar container. + sidecarsMap: {} + # sidecar-container: + # image: busybox + # # If your starrocksBeSpec.storageSpec.name is 'be' or not set, you can mount the volume of data like this. + # command: ['sh', '-c', 'echo "hello from the sidecar container" >/opt/starrocks/be/storage/sidecar-data.txt && sleep 3600'] + # volumeMounts: + # - mountPath: /opt/starrocks/be/storage + # name: be-data # append '-data' to the end of the name of the starrocksBeSpec.storageSpec.name + # initContainers is an optional list of containers that are run in the same pod as the starrocks component. + # You can use this to launch helper containers that run before the main container starts. + # See https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#Container for how to configure a container. + initContainers: [] + # - name: init-container + # image: busybox + # # If your starrocksBeSpec.storageSpec.name is 'be' or not set, you can mount the volume of data like this. + # command: ['sh', '-c', 'echo "hello from the init container" >/opt/starrocks/be/storage/init-data.txt'] + # volumeMounts: + # - mountPath: /opt/starrocks/be/storage + # name: be-data # append '-data' to the end of the starrocksBeSpec.storageSpec.name + # Max unavailable pods for the BE component when doing rolling update. + # This field cannot be 0. The default setting is 1. + # Note: Because Operator uses statefulset to manage this component, the maxUnavailable field is in Alpha stage, and it is honored + # only by API servers that are running with the MaxUnavailableStatefulSet feature gate enabled. + # See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#maximum-unavailable-pods for more details. + maxUnavailablePods: + # Share a single process namespace between all of the containers in a pod. + # When this is set, containers will be able to view and signal processes from other containers + # in the same pod, and the first process in each container will not be assigned PID 1. + shareProcessNamespace: + +# create secrets if necessary. +secrets: [] + # e.g., create my-secret + # - name: my-secret + # data: + # key: | + # this is the content of the secret + # when mounted, the key will be the name of the file + +# create configmaps if necessary. +configMaps: [] + # e.g., create my-configmap + # - name: my-configmap + # data: + # key: | + # this is the content of the configmap + # when mounted, the key will be the name of the file + +# If you need to deploy other resources, e.g., serviceAccount, you can add them here. +# You can even deploy resources to different namespaces +resources: [] + # - apiVersion: v1 + # kind: ServiceAccount + # metadata: + # name: sa-for-starrocks + # namespace: starrocks + +# specify the FE proxy deployment or not. +starrocksFeProxySpec: + # specify the FE proxy deployment or not. + enabled: false + replicas: 1 + imagePullPolicy: IfNotPresent + # default nginx:1.24.0 + image: + repository: "" + tag: "" + resources: + requests: + cpu: 1 + memory: 2Gi + limits: + cpu: 1 + memory: 2Gi + # set the resolver for nginx server, default kube-dns.kube-system.svc.cluster.local + resolver: "" + service: + # the FE proxy service type, only supported ClusterIP, NodePort, LoadBalancer + # default ClusterIP + type: ClusterIP + # the loadBalancerIP for static ip config when the type=LoadBalancer and loadbalancerIp is not empty. + loadbalancerIP: "" + # add annotations for external FE proxy service. + annotations: {} + # Add labels for external FE proxy service. The operator may add its own default labels. + labels: {} + # Config the service port for FE proxy service. + # To assign a specific port or nodePort to a service, you should specify them by the corresponding name or + # containerPort in the service configuration. If both containerPort and name are specified, containerPort takes precedence. + # For FE proxy, the port name can be http-port, and its default container port is 8080. + ports: [] + # e.g., specify a dedicated node port for FE proxy service by containerPort. + # - nodePort: 30080 # The range of valid ports is 30000-32767 + # containerPort: 8080 # The port on the container to expose. + # Specify the source IP ranges for the load balancer when the type=LoadBalancer. + loadBalancerSourceRanges: [] + # - 10.0.0.0/8 + # imagePullSecrets allows you to use secrets for pulling images for your pods. + imagePullSecrets: [] + # - name: "image-pull-secret" + # If specified, the pod's nodeSelector,displayName="Map of nodeSelectors to match when scheduling pods on nodes" + # Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector + nodeSelector: {} + # kubernetes.io/arch: amd64 + # kubernetes.io/os: linux + # affinity for FE proxy pod scheduling. + affinity: {} + # nodeAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # nodeSelectorTerms: + # - matchFields: + # - key: metadata.name + # operator: In + # values: + # - target-host-name + # podAntiAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # - labelSelector: + # matchExpressions: + # - key: app.kubernetes.io/component + # operator: In + # values: + # - fe-proxy + # topologyKey: "kubernetes.io/hostname" + # Node tolerations for FE proxy pod scheduling to nodes with taints + # Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + tolerations: [] + # - key: "key" + # operator: "Equal|Exists" + # value: "value" + # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" + + # Please upgrade the CRD with v1.8.7 released version if you want to use the following configuration. + # including: livenessProbeFailureSeconds, readinessProbeFailureSeconds + + # LivenessProbeFailureSeconds defines the total failure seconds of liveness Probe. + # the default value is 15 seconds + # You can set it to "0" to disable the probe. + livenessProbeFailureSeconds: + # ReadinessProbeFailureSeconds defines the total failure seconds of a readiness Probe. + # the default value is 15 seconds + # You can set it to "0" to disable the probe. + readinessProbeFailureSeconds: + # Note: will create emptyDir volume for FE proxy, PVC is not supported. + emptyDirs: [] + # e.g., mount an emptyDir volume to /tmp + # - name: tmp-data + # mountPath: /tmp + # the pod labels for user select or classify pods. + podLabels: {}