From ecc9a15597787c46100d12af35c28bc8c3101567 Mon Sep 17 00:00:00 2001 From: weekface Date: Mon, 15 Jun 2020 17:21:21 +0800 Subject: [PATCH] fix: alert rules lost after rolling upgrade --- charts/tidb-cluster/templates/monitor-deployment.yaml | 4 ++++ charts/tidb-cluster/values.yaml | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/charts/tidb-cluster/templates/monitor-deployment.yaml b/charts/tidb-cluster/templates/monitor-deployment.yaml index b297a1553c6..53c17f0aeaa 100644 --- a/charts/tidb-cluster/templates/monitor-deployment.yaml +++ b/charts/tidb-cluster/templates/monitor-deployment.yaml @@ -67,7 +67,11 @@ spec: - name: PROM_PERSISTENT_DIR value: /data - name: TIDB_VERSION + {{- if .Values.monitor.prometheus.alertManagerRulesVersion }} + value: tidb:{{ .Values.monitor.prometheus.alertManagerRulesVersion }} + {{- else }} value: {{ .Values.tidb.image }} + {{- end }} - name: GF_K8S_PROMETHEUS_URL value: {{ .Values.monitor.initializer.config.K8S_PROMETHEUS_URL }} - name: GF_TIDB_PROMETHEUS_URL diff --git a/charts/tidb-cluster/values.yaml b/charts/tidb-cluster/values.yaml index 72e3cee6eb4..230ed4a6999 100644 --- a/charts/tidb-cluster/values.yaml +++ b/charts/tidb-cluster/values.yaml @@ -573,6 +573,11 @@ monitor: portName: http-prometheus reserveDays: 12 # alertmanagerURL: "" + + # alertManagerRulesVersion is the version of the tidb cluster that used for alert rules. + # default to current tidb cluster version, for example: v3.0.15 + # + # alertManagerRulesVersion: "" nodeSelector: {} # kind: monitor # zone: cn-bj1-01,cn-bj1-02