From cb35037e984f688feb40e493a094afcd1a467e30 Mon Sep 17 00:00:00 2001 From: boxker Date: Sun, 8 Dec 2024 07:31:22 +0800 Subject: [PATCH] fix: wrong references of helm values in the prometheus template (#4543) Signed-off-by: boxker Co-authored-by: Yue Yang --- CHANGELOG.md | 1 + helm/chaos-mesh/templates/prometheus-deployment.yaml | 12 ++++++------ helm/chaos-mesh/values.schema.json | 8 ++++++++ helm/chaos-mesh/values.yaml | 3 +++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7182f54c4..ea76e92998 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ For more information and how-to, see [RFC: Keep A Changelog](https://github.com/ ### Fixed - Issue with getting a single archive in the Dashboard UI [#4521](https://github.com/chaos-mesh/chaos-mesh/pull/4521) +- Wrong references of helm values in the prometheus template [#4543](https://github.com/chaos-mesh/chaos-mesh/pull/4543) ### Security diff --git a/helm/chaos-mesh/templates/prometheus-deployment.yaml b/helm/chaos-mesh/templates/prometheus-deployment.yaml index c04d9d277d..a71b010501 100644 --- a/helm/chaos-mesh/templates/prometheus-deployment.yaml +++ b/helm/chaos-mesh/templates/prometheus-deployment.yaml @@ -47,7 +47,7 @@ spec: {{- end }} initContainers: - name: data-permission-fix - image: busybox + image: {{ .Values.prometheus.busybox.image }} command: ["/bin/chmod","-R","777", "/data"] volumeMounts: - name: data @@ -56,9 +56,9 @@ spec: - name: prometheus image: {{ .Values.prometheus.image }} imagePullPolicy: {{ .Values.prometheus.imagePullPolicy | default "IfNotPresent" }} - {{- if .Values.chaosDaemon.resources }} + {{- if .Values.prometheus.resources }} resources: - {{ toYaml .Values.chaosDaemon.resources | indent 12 }} +{{ toYaml .Values.prometheus.resources | indent 12 }} {{- end }} args: - --storage.tsdb.path=/data @@ -88,15 +88,15 @@ spec: - configMap: name: prometheus-config name: prometheus-config - {{- with .Values.controllerManager.nodeSelector }} + {{- with .Values.prometheus.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} {{- end }} - {{- with .Values.controllerManager.affinity }} + {{- with .Values.prometheus.affinity }} affinity: {{ toYaml . | indent 8 }} {{- end }} - {{- with .Values.controllerManager.tolerations }} + {{- with .Values.prometheus.tolerations }} tolerations: {{ toYaml . | indent 8 }} {{- end }} diff --git a/helm/chaos-mesh/values.schema.json b/helm/chaos-mesh/values.schema.json index 581111eccb..cbb2992903 100644 --- a/helm/chaos-mesh/values.schema.json +++ b/helm/chaos-mesh/values.schema.json @@ -744,6 +744,14 @@ "properties": {}, "type": "object" }, + "busybox": { + "properties": { + "image": { + "type": "string" + } + }, + "type": "object" + }, "create": { "type": "boolean" }, diff --git a/helm/chaos-mesh/values.yaml b/helm/chaos-mesh/values.yaml index 220ecbf37f..fcf5793e6e 100644 --- a/helm/chaos-mesh/values.yaml +++ b/helm/chaos-mesh/values.yaml @@ -494,6 +494,9 @@ prometheus: serviceAccount: prometheus # Docker image for prometheus image: prom/prometheus:v2.18.1 + # Docker image for busybox + busybox: + image: busybox # Image pull policy imagePullPolicy: IfNotPresent # Custom priorityClassName for using pod priorities