From 0328d1f2a0dfd091a566c8c3f839bfac9545c299 Mon Sep 17 00:00:00 2001 From: Nicolas Lamirault Date: Tue, 21 Jan 2025 08:03:07 +0100 Subject: [PATCH] feat: Add additional labels to the kubernetes resources (#218) * feat(operator): add missing labels Signed-off-by: Nicolas Lamirault * feat(operator): Kubernetes recommended labels Signed-off-by: Nicolas Lamirault * feat(standalone): Kubernetes recommended labels Signed-off-by: Nicolas Lamirault * feat(cluster): Kubernetes recommended labels Signed-off-by: Nicolas Lamirault * feat(cluster): new file Signed-off-by: Nicolas Lamirault * feat(helm): naming Signed-off-by: Nicolas Lamirault * feat(helm): additional labels Signed-off-by: Nicolas Lamirault * feat(helm): bump charts versions Signed-off-by: Nicolas Lamirault * feat(helm): documentation Signed-off-by: Nicolas Lamirault * fix(helm): documentation Signed-off-by: Nicolas Lamirault * fix(helm): use root variable Signed-off-by: Nicolas Lamirault --------- Signed-off-by: Nicolas Lamirault --- charts/greptimedb-cluster/Chart.yaml | 2 +- charts/greptimedb-cluster/README.md | 3 +- .../greptimedb-cluster/templates/_helpers.tpl | 68 +++++++++++++++++++ .../greptimedb-cluster/templates/cluster.yaml | 2 + .../templates/debug-depoyment.yaml | 1 + .../grafana-dashboards-configmap.yaml | 2 + .../greptimedb-cluster/templates/secret.yaml | 2 + .../templates/serviceaccount-datanode.yaml | 2 + .../templates/serviceaccount-flownode.yaml | 2 + .../templates/serviceaccount-frontend.yaml | 2 + .../templates/serviceaccount-meta.yaml | 2 + .../templates/users-auth-secret.yaml | 2 + charts/greptimedb-cluster/values.yaml | 3 + charts/greptimedb-operator/Chart.yaml | 2 +- charts/greptimedb-operator/README.md | 3 +- .../templates/_helpers.tpl | 5 ++ .../templates/clusterrole.yaml | 2 + .../templates/clusterrolebinding.yaml | 2 + .../greptimedb-operator/templates/role.yaml | 2 + .../templates/rolebinding.yaml | 2 + .../templates/service.yaml | 2 + .../templates/serviceaccount.yaml | 2 + charts/greptimedb-operator/values.yaml | 3 + charts/greptimedb-standalone/Chart.yaml | 2 +- charts/greptimedb-standalone/README.md | 3 +- .../templates/_helpers.tpl | 5 ++ .../templates/podmonitor.yaml | 5 +- .../templates/secret.yaml | 2 + .../templates/users-auth-secret.yaml | 2 + charts/greptimedb-standalone/values.yaml | 3 + 30 files changed, 132 insertions(+), 8 deletions(-) create mode 100644 charts/greptimedb-cluster/templates/_helpers.tpl diff --git a/charts/greptimedb-cluster/Chart.yaml b/charts/greptimedb-cluster/Chart.yaml index 49655b9..259be9d 100644 --- a/charts/greptimedb-cluster/Chart.yaml +++ b/charts/greptimedb-cluster/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: greptimedb-cluster description: A Helm chart for deploying GreptimeDB cluster in Kubernetes. type: application -version: 0.2.44 +version: 0.2.45 appVersion: 0.11.2 home: https://github.com/GreptimeTeam/greptimedb sources: diff --git a/charts/greptimedb-cluster/README.md b/charts/greptimedb-cluster/README.md index 4f98a0e..18f3262 100644 --- a/charts/greptimedb-cluster/README.md +++ b/charts/greptimedb-cluster/README.md @@ -2,7 +2,7 @@ A Helm chart for deploying GreptimeDB cluster in Kubernetes. -![Version: 0.2.44](https://img.shields.io/badge/Version-0.2.44-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.11.2](https://img.shields.io/badge/AppVersion-0.11.2-informational?style=flat-square) +![Version: 0.2.45](https://img.shields.io/badge/Version-0.2.45-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.11.2](https://img.shields.io/badge/AppVersion-0.11.2-informational?style=flat-square) ## Source Code @@ -80,6 +80,7 @@ helm uninstall mycluster -n default | Key | Type | Default | Description | |-----|------|---------|-------------| +| additionalLabels | object | `{}` | additional labels to add to all resources | | auth | object | `{"enabled":false,"fileName":"passwd","mountPath":"/etc/greptimedb/auth","users":[{"password":"admin","username":"admin"}]}` | The static auth for greptimedb, only support one user now(https://docs.greptime.com/user-guide/deployments/authentication/static). | | auth.enabled | bool | `false` | Enable static auth | | auth.fileName | string | `"passwd"` | The auth file name, the full path is `${mountPath}/${fileName}` | diff --git a/charts/greptimedb-cluster/templates/_helpers.tpl b/charts/greptimedb-cluster/templates/_helpers.tpl new file mode 100644 index 0000000..f35e5b0 --- /dev/null +++ b/charts/greptimedb-cluster/templates/_helpers.tpl @@ -0,0 +1,68 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "greptimedb-cluster.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "greptimedb-cluster.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "greptimedb-cluster.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "greptimedb-cluster.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "greptimedb-cluster.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "greptimedb-cluster.labels" -}} +helm.sh/chart: {{ include "greptimedb-cluster.chart" . }} +{{ include "greptimedb-cluster.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/component: cluster +app.kubernetes.io/managed-by: {{ .Release.Service }} +app.kubernetes.io/part-of: greptimedb-cluster +{{- with .Values.additionalLabels }} +{{ toYaml . }} +{{- end }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "greptimedb-cluster.selectorLabels" -}} +app.kubernetes.io/name: {{ include "greptimedb-cluster.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/charts/greptimedb-cluster/templates/cluster.yaml b/charts/greptimedb-cluster/templates/cluster.yaml index a6f531b..48759b1 100644 --- a/charts/greptimedb-cluster/templates/cluster.yaml +++ b/charts/greptimedb-cluster/templates/cluster.yaml @@ -3,6 +3,8 @@ kind: GreptimeDBCluster metadata: name: {{ .Release.Name }} namespace: {{ .Release.Namespace }} + labels: + {{- include "greptimedb-cluster.labels" . | nindent 4 }} spec: base: main: diff --git a/charts/greptimedb-cluster/templates/debug-depoyment.yaml b/charts/greptimedb-cluster/templates/debug-depoyment.yaml index fac1a9a..d807ca3 100644 --- a/charts/greptimedb-cluster/templates/debug-depoyment.yaml +++ b/charts/greptimedb-cluster/templates/debug-depoyment.yaml @@ -6,6 +6,7 @@ metadata: name: {{ .Release.Name }}-debug-pod namespace: {{ .Release.Namespace }} labels: + {{- include "greptimedb-cluster.labels" . | nindent 4 }} app: {{ .Release.Name }}-debug-pod spec: replicas: 1 diff --git a/charts/greptimedb-cluster/templates/grafana-dashboards-configmap.yaml b/charts/greptimedb-cluster/templates/grafana-dashboards-configmap.yaml index 25f4571..4631a35 100644 --- a/charts/greptimedb-cluster/templates/grafana-dashboards-configmap.yaml +++ b/charts/greptimedb-cluster/templates/grafana-dashboards-configmap.yaml @@ -6,6 +6,8 @@ kind: ConfigMap metadata: name: {{ $value }} namespace: {{ $root.Release.Namespace }} + labels: + {{- include "greptimedb-cluster.labels" $root | nindent 4 }} data: {{ $key }}.json: |- {{ $root.Files.Get (printf "dashboards/%s.json" $key) | indent 4 }} diff --git a/charts/greptimedb-cluster/templates/secret.yaml b/charts/greptimedb-cluster/templates/secret.yaml index 4023066..5696fad 100644 --- a/charts/greptimedb-cluster/templates/secret.yaml +++ b/charts/greptimedb-cluster/templates/secret.yaml @@ -5,6 +5,8 @@ apiVersion: v1 metadata: name: {{ default "storage-credentials" .Values.objectStorage.credentials.secretName }} namespace: {{ .Release.Namespace }} + labels: + {{- include "greptimedb-cluster.labels" . | nindent 4 }} kind: Secret type: Opaque {{- if .Values.objectStorage.credentials.serviceAccountKey }} diff --git a/charts/greptimedb-cluster/templates/serviceaccount-datanode.yaml b/charts/greptimedb-cluster/templates/serviceaccount-datanode.yaml index b964ef2..e21b7ac 100644 --- a/charts/greptimedb-cluster/templates/serviceaccount-datanode.yaml +++ b/charts/greptimedb-cluster/templates/serviceaccount-datanode.yaml @@ -4,6 +4,8 @@ kind: ServiceAccount metadata: name: {{ .Release.Name }}-datanode namespace: {{ .Release.Namespace }} + labels: + {{- include "greptimedb-cluster.labels" . | nindent 4 }} {{- with .Values.datanode.podTemplate.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/greptimedb-cluster/templates/serviceaccount-flownode.yaml b/charts/greptimedb-cluster/templates/serviceaccount-flownode.yaml index c00df6d..2b20931 100644 --- a/charts/greptimedb-cluster/templates/serviceaccount-flownode.yaml +++ b/charts/greptimedb-cluster/templates/serviceaccount-flownode.yaml @@ -4,6 +4,8 @@ kind: ServiceAccount metadata: name: {{ .Release.Name }}-flownode namespace: {{ .Release.Namespace }} + labels: + {{- include "greptimedb-cluster.labels" . | nindent 4 }} {{- with .Values.flownode.podTemplate.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/greptimedb-cluster/templates/serviceaccount-frontend.yaml b/charts/greptimedb-cluster/templates/serviceaccount-frontend.yaml index 1e4672c..5017944 100644 --- a/charts/greptimedb-cluster/templates/serviceaccount-frontend.yaml +++ b/charts/greptimedb-cluster/templates/serviceaccount-frontend.yaml @@ -4,6 +4,8 @@ kind: ServiceAccount metadata: name: {{ .Release.Name }}-frontend namespace: {{ .Release.Namespace }} + labels: + {{- include "greptimedb-cluster.labels" . | nindent 4 }} {{- with .Values.frontend.podTemplate.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/greptimedb-cluster/templates/serviceaccount-meta.yaml b/charts/greptimedb-cluster/templates/serviceaccount-meta.yaml index 6784e83..c92fb69 100644 --- a/charts/greptimedb-cluster/templates/serviceaccount-meta.yaml +++ b/charts/greptimedb-cluster/templates/serviceaccount-meta.yaml @@ -4,6 +4,8 @@ kind: ServiceAccount metadata: name: {{ .Release.Name }}-meta namespace: {{ .Release.Namespace }} + labels: + {{- include "greptimedb-cluster.labels" . | nindent 4 }} {{- with .Values.meta.podTemplate.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/greptimedb-cluster/templates/users-auth-secret.yaml b/charts/greptimedb-cluster/templates/users-auth-secret.yaml index a74cbe6..6b977c4 100644 --- a/charts/greptimedb-cluster/templates/users-auth-secret.yaml +++ b/charts/greptimedb-cluster/templates/users-auth-secret.yaml @@ -4,6 +4,8 @@ kind: Secret metadata: name: {{ .Release.Name }}-users-auth namespace: {{ .Release.Namespace }} + labels: + {{- include "greptimedb-cluster.labels" . | nindent 4 }} type: Opaque stringData: {{ .Values.auth.fileName }}: | diff --git a/charts/greptimedb-cluster/values.yaml b/charts/greptimedb-cluster/values.yaml index 144ead6..2180f47 100644 --- a/charts/greptimedb-cluster/values.yaml +++ b/charts/greptimedb-cluster/values.yaml @@ -8,6 +8,9 @@ image: # -- The image pull secrets pullSecrets: [] +# -- additional labels to add to all resources +additionalLabels: {} + initializer: # -- Initializer image registry registry: docker.io diff --git a/charts/greptimedb-operator/Chart.yaml b/charts/greptimedb-operator/Chart.yaml index ee193c7..c33e881 100644 --- a/charts/greptimedb-operator/Chart.yaml +++ b/charts/greptimedb-operator/Chart.yaml @@ -3,7 +3,7 @@ kubeVersion: ">=1.18.0-0" description: The greptimedb-operator Helm chart for Kubernetes. name: greptimedb-operator appVersion: 0.1.4-alpha.3 -version: 0.2.15 +version: 0.2.16 type: application home: https://github.com/GreptimeTeam/greptimedb-operator sources: diff --git a/charts/greptimedb-operator/README.md b/charts/greptimedb-operator/README.md index ee7ed10..9755bd6 100644 --- a/charts/greptimedb-operator/README.md +++ b/charts/greptimedb-operator/README.md @@ -2,7 +2,7 @@ The greptimedb-operator Helm chart for Kubernetes. -![Version: 0.2.15](https://img.shields.io/badge/Version-0.2.15-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.4-alpha.3](https://img.shields.io/badge/AppVersion-0.1.4--alpha.3-informational?style=flat-square) +![Version: 0.2.16](https://img.shields.io/badge/Version-0.2.16-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.4-alpha.3](https://img.shields.io/badge/AppVersion-0.1.4--alpha.3-informational?style=flat-square) ## Source Code @@ -100,6 +100,7 @@ Kubernetes: `>=1.18.0-0` | Key | Type | Default | Description | |-----|------|---------|-------------| +| additionalLabels | object | `{}` | additional labels to add to all resources | | affinity | object | `{}` | The pod affinity | | apiServer | object | `{"enabled":false,"podMetrics":{"enabled":false},"port":8081}` | The configuration for the operator API server | | apiServer.enabled | bool | `false` | Whether to enable the API server | diff --git a/charts/greptimedb-operator/templates/_helpers.tpl b/charts/greptimedb-operator/templates/_helpers.tpl index 6a7d429..9c21d8d 100644 --- a/charts/greptimedb-operator/templates/_helpers.tpl +++ b/charts/greptimedb-operator/templates/_helpers.tpl @@ -51,7 +51,12 @@ helm.sh/chart: {{ include "greptimedb-operator.chart" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} +app.kubernetes.io/component: operator app.kubernetes.io/managed-by: {{ .Release.Service }} +app.kubernetes.io/part-of: greptimedb-operator +{{- with .Values.additionalLabels }} +{{ toYaml . }} +{{- end }} {{- end }} {{/* diff --git a/charts/greptimedb-operator/templates/clusterrole.yaml b/charts/greptimedb-operator/templates/clusterrole.yaml index 516e310..54f9db8 100644 --- a/charts/greptimedb-operator/templates/clusterrole.yaml +++ b/charts/greptimedb-operator/templates/clusterrole.yaml @@ -3,6 +3,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: {{ include "greptimedb-operator.fullname" . }}-role + labels: + {{- include "greptimedb-operator.labels" . | nindent 4 }} rules: - apiGroups: - apiextensions.k8s.io diff --git a/charts/greptimedb-operator/templates/clusterrolebinding.yaml b/charts/greptimedb-operator/templates/clusterrolebinding.yaml index 683966b..217ab7d 100644 --- a/charts/greptimedb-operator/templates/clusterrolebinding.yaml +++ b/charts/greptimedb-operator/templates/clusterrolebinding.yaml @@ -3,6 +3,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: {{ include "greptimedb-operator.fullname" . }}-rolebinding + labels: + {{- include "greptimedb-operator.labels" . | nindent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole diff --git a/charts/greptimedb-operator/templates/role.yaml b/charts/greptimedb-operator/templates/role.yaml index 5454fe2..d5eb38e 100644 --- a/charts/greptimedb-operator/templates/role.yaml +++ b/charts/greptimedb-operator/templates/role.yaml @@ -4,6 +4,8 @@ kind: Role metadata: name: {{ include "greptimedb-operator.fullname" . }}-leader-election-role namespace: {{ .Release.Namespace }} + labels: + {{- include "greptimedb-operator.labels" . | nindent 4 }} rules: - apiGroups: - '' diff --git a/charts/greptimedb-operator/templates/rolebinding.yaml b/charts/greptimedb-operator/templates/rolebinding.yaml index 529f18a..95ad515 100644 --- a/charts/greptimedb-operator/templates/rolebinding.yaml +++ b/charts/greptimedb-operator/templates/rolebinding.yaml @@ -4,6 +4,8 @@ kind: RoleBinding metadata: name: {{ include "greptimedb-operator.fullname" . }}-leader-election-rolebinding namespace: {{ .Release.Namespace }} + labels: + {{- include "greptimedb-operator.labels" . | nindent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role diff --git a/charts/greptimedb-operator/templates/service.yaml b/charts/greptimedb-operator/templates/service.yaml index f6265bb..29b74ce 100644 --- a/charts/greptimedb-operator/templates/service.yaml +++ b/charts/greptimedb-operator/templates/service.yaml @@ -4,6 +4,8 @@ kind: Service metadata: name: {{ include "greptimedb-operator.fullname" . }} namespace: {{ .Release.Namespace }} + labels: + {{- include "greptimedb-operator.labels" . | nindent 4 }} spec: type: ClusterIP selector: diff --git a/charts/greptimedb-operator/templates/serviceaccount.yaml b/charts/greptimedb-operator/templates/serviceaccount.yaml index edb7485..9eaa645 100644 --- a/charts/greptimedb-operator/templates/serviceaccount.yaml +++ b/charts/greptimedb-operator/templates/serviceaccount.yaml @@ -4,4 +4,6 @@ kind: ServiceAccount metadata: name: {{ include "greptimedb-operator.serviceAccountName" . }} namespace: {{ .Release.Namespace }} + labels: + {{- include "greptimedb-operator.labels" . | nindent 4 }} {{- end }} diff --git a/charts/greptimedb-operator/values.yaml b/charts/greptimedb-operator/values.yaml index 400a8fa..49d05de 100644 --- a/charts/greptimedb-operator/values.yaml +++ b/charts/greptimedb-operator/values.yaml @@ -12,6 +12,9 @@ image: # -- The image pull secrets pullSecrets: [] +# -- additional labels to add to all resources +additionalLabels: {} + serviceAccount: # -- Specifies whether a service account should be created create: true diff --git a/charts/greptimedb-standalone/Chart.yaml b/charts/greptimedb-standalone/Chart.yaml index eca4416..dad7a09 100644 --- a/charts/greptimedb-standalone/Chart.yaml +++ b/charts/greptimedb-standalone/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: greptimedb-standalone description: A Helm chart for deploying standalone greptimedb type: application -version: 0.1.39 +version: 0.1.40 appVersion: 0.11.2 home: https://github.com/GreptimeTeam/greptimedb sources: diff --git a/charts/greptimedb-standalone/README.md b/charts/greptimedb-standalone/README.md index 85a4e3f..7b53582 100644 --- a/charts/greptimedb-standalone/README.md +++ b/charts/greptimedb-standalone/README.md @@ -2,7 +2,7 @@ A Helm chart for deploying standalone greptimedb -![Version: 0.1.39](https://img.shields.io/badge/Version-0.1.39-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.11.2](https://img.shields.io/badge/AppVersion-0.11.2-informational?style=flat-square) +![Version: 0.1.40](https://img.shields.io/badge/Version-0.1.40-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.11.2](https://img.shields.io/badge/AppVersion-0.11.2-informational?style=flat-square) ## Source Code - https://github.com/GreptimeTeam/greptimedb @@ -50,6 +50,7 @@ helm uninstall greptimedb-standalone -n default | Key | Type | Default | Description | |-----|------|---------|-------------| +| additionalLabels | object | `{}` | additional labels to add to all resources | | affinity | object | `{}` | Affinity configuration for pod | | annotations | object | `{}` | The annotations | | args | list | `[]` | The container args | diff --git a/charts/greptimedb-standalone/templates/_helpers.tpl b/charts/greptimedb-standalone/templates/_helpers.tpl index 2b58967..05d91fb 100644 --- a/charts/greptimedb-standalone/templates/_helpers.tpl +++ b/charts/greptimedb-standalone/templates/_helpers.tpl @@ -39,7 +39,12 @@ helm.sh/chart: {{ include "greptimedb-standalone.chart" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} +app.kubernetes.io/component: standalone app.kubernetes.io/managed-by: {{ .Release.Service }} +app.kubernetes.io/part-of: greptimedb-standalone +{{- with .Values.additionalLabels }} +{{ toYaml . }} +{{- end }} {{- end }} {{/* diff --git a/charts/greptimedb-standalone/templates/podmonitor.yaml b/charts/greptimedb-standalone/templates/podmonitor.yaml index 462c020..2368d80 100644 --- a/charts/greptimedb-standalone/templates/podmonitor.yaml +++ b/charts/greptimedb-standalone/templates/podmonitor.yaml @@ -4,10 +4,11 @@ kind: PodMonitor metadata: name: {{ include "greptimedb-standalone.fullname" . }} namespace: {{ .Release.Namespace }} - {{- with .Values.monitoring.labels }} labels: + {{- include "greptimedb-standalone.labels" . | nindent 4 }} + {{- with .Values.monitoring.labels }} {{- toYaml . | nindent 4 }} - {{- end }} + {{- end }} {{- with .Values.monitoring.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/greptimedb-standalone/templates/secret.yaml b/charts/greptimedb-standalone/templates/secret.yaml index 9abd14d..f32be55 100644 --- a/charts/greptimedb-standalone/templates/secret.yaml +++ b/charts/greptimedb-standalone/templates/secret.yaml @@ -5,6 +5,8 @@ apiVersion: v1 metadata: name: {{ include "greptimedb-standalone.fullname" . }}-secret namespace: {{ .Release.Namespace }} + labels: + {{- include "greptimedb-standalone.labels" . | nindent 4 }} kind: Secret type: Opaque {{- if .Values.objectStorage.credentials.serviceAccountKey }} diff --git a/charts/greptimedb-standalone/templates/users-auth-secret.yaml b/charts/greptimedb-standalone/templates/users-auth-secret.yaml index 354d474..46800c9 100644 --- a/charts/greptimedb-standalone/templates/users-auth-secret.yaml +++ b/charts/greptimedb-standalone/templates/users-auth-secret.yaml @@ -4,6 +4,8 @@ kind: Secret metadata: name: {{ include "greptimedb-standalone.fullname" . }}-users-auth namespace: {{ .Release.Namespace }} + labels: + {{- include "greptimedb-standalone.labels" . | nindent 4 }} type: Opaque stringData: {{ .Values.auth.fileName }}: | diff --git a/charts/greptimedb-standalone/values.yaml b/charts/greptimedb-standalone/values.yaml index 95ffe3d..ad3f3d0 100644 --- a/charts/greptimedb-standalone/values.yaml +++ b/charts/greptimedb-standalone/values.yaml @@ -16,6 +16,9 @@ nameOverride: "" # -- Provide a name to substitute for the full names of resources fullnameOverride: "" +# -- additional labels to add to all resources +additionalLabels: {} + serviceAccount: # -- Specifies whether a service account should be created create: true