From 6378a2d36f49cff51426fa72752214a049fb4dd6 Mon Sep 17 00:00:00 2001 From: Louis Date: Tue, 9 Apr 2019 12:32:40 +0800 Subject: [PATCH] add extraLabels variable in tidb-cluster chart (#373) --- charts/tidb-cluster/templates/tidb-cluster.yaml | 3 +++ charts/tidb-cluster/values.yaml | 4 ++++ images/tidb-operator-e2e/tidb-cluster-values.yaml | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/charts/tidb-cluster/templates/tidb-cluster.yaml b/charts/tidb-cluster/templates/tidb-cluster.yaml index beb93718a0..d8eaea3d0d 100644 --- a/charts/tidb-cluster/templates/tidb-cluster.yaml +++ b/charts/tidb-cluster/templates/tidb-cluster.yaml @@ -8,6 +8,9 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: tidb-cluster helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + {{- if .Values.extraLabels }} +{{ toYaml .Values.extraLabels | indent 4 }} + {{- end }} spec: pvReclaimPolicy: {{ .Values.pvReclaimPolicy }} timezone: {{ .Values.timezone | default "UTC" }} diff --git a/charts/tidb-cluster/values.yaml b/charts/tidb-cluster/values.yaml index c0fd8be1fb..11b7545b8b 100644 --- a/charts/tidb-cluster/values.yaml +++ b/charts/tidb-cluster/values.yaml @@ -11,6 +11,10 @@ rbac: # if multiple clusters are deployed in the same namespace. clusterName: demo +# Add additional TidbCluster labels +# ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +extraLabels: {} + # schedulerName must be same with charts/tidb-operator/values#scheduler.schedulerName schedulerName: tidb-scheduler diff --git a/images/tidb-operator-e2e/tidb-cluster-values.yaml b/images/tidb-operator-e2e/tidb-cluster-values.yaml index 45e4398f29..8ca3dc2ddb 100644 --- a/images/tidb-operator-e2e/tidb-cluster-values.yaml +++ b/images/tidb-operator-e2e/tidb-cluster-values.yaml @@ -11,6 +11,10 @@ rbac: # if multiple clusters are deployed in the same namespace. clusterName: demo-cluster +# Add additional TidbCluster labels +# ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +extraLabels: {} + # schedulerName must be same with charts/tidb-operator/values#scheduler.schedulerName schedulerName: tidb-scheduler