From 2a5323b3dc91acf35fb69ff93bec6e007fca9bbb Mon Sep 17 00:00:00 2001 From: TheRealNoob Date: Tue, 28 Jan 2025 17:09:19 -0600 Subject: [PATCH 1/3] [kube-prometheus-stack] rename additional rules Signed-off-by: TheRealNoob --- charts/kube-prometheus-stack/Chart.yaml | 2 +- .../templates/prometheus/additionalPrometheusRules.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index d64ce9251da0..e6405ea55d07 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -31,7 +31,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 68.3.0 +version: 69.0.0 appVersion: v0.79.2 kubeVersion: ">=1.19.0-0" home: https://github.com/prometheus-operator/kube-prometheus diff --git a/charts/kube-prometheus-stack/templates/prometheus/additionalPrometheusRules.yaml b/charts/kube-prometheus-stack/templates/prometheus/additionalPrometheusRules.yaml index cb4aabaa7b52..faab86165b45 100644 --- a/charts/kube-prometheus-stack/templates/prometheus/additionalPrometheusRules.yaml +++ b/charts/kube-prometheus-stack/templates/prometheus/additionalPrometheusRules.yaml @@ -10,7 +10,7 @@ items: - apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: - name: {{ template "kube-prometheus-stack.name" $ }}-{{ $prometheusRuleName }} + name: {{ template "kube-prometheus-stack.fullname" $ }}-{{ $prometheusRuleName }} namespace: {{ template "kube-prometheus-stack.namespace" $ }} labels: app: {{ template "kube-prometheus-stack.name" $ }} @@ -27,7 +27,7 @@ items: - apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: - name: {{ template "kube-prometheus-stack.name" $ }}-{{ .name }} + name: {{ template "kube-prometheus-stack.fullname" $ }}-{{ .name }} namespace: {{ template "kube-prometheus-stack.namespace" $ }} labels: app: {{ template "kube-prometheus-stack.name" $ }} From 13d57b19a2a25ad59c4e0cd1d13bdcfbe41c0cea Mon Sep 17 00:00:00 2001 From: TheRealNoob Date: Wed, 29 Jan 2025 02:27:26 -0600 Subject: [PATCH 2/3] re-add comment Signed-off-by: TheRealNoob --- charts/kube-prometheus-stack/Chart.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index 88881518a258..8051d3afcbc4 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -31,6 +31,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus +# in case of changes within CRDs, a major version bump is mandatory. See: https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack#upgrading-chart version: 69.0.0 appVersion: v0.79.2 kubeVersion: ">=1.19.0-0" From c8658c93b3305b930c198fa291d9ab63dfc7e81c Mon Sep 17 00:00:00 2001 From: TheRealNoob Date: Wed, 29 Jan 2025 02:40:26 -0600 Subject: [PATCH 3/3] trunc 63 metadata.name Signed-off-by: TheRealNoob --- .../templates/prometheus/additionalPrometheusRules.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/kube-prometheus-stack/templates/prometheus/additionalPrometheusRules.yaml b/charts/kube-prometheus-stack/templates/prometheus/additionalPrometheusRules.yaml index faab86165b45..f44b9bb542e5 100644 --- a/charts/kube-prometheus-stack/templates/prometheus/additionalPrometheusRules.yaml +++ b/charts/kube-prometheus-stack/templates/prometheus/additionalPrometheusRules.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: List metadata: - name: {{ include "kube-prometheus-stack.fullname" $ }}-additional-prometheus-rules + name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" $) "additional-prometheus-rules" | trunc 63 | trimSuffix "-" }} namespace: {{ template "kube-prometheus-stack.namespace" . }} items: {{- if .Values.additionalPrometheusRulesMap }} @@ -10,7 +10,7 @@ items: - apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: - name: {{ template "kube-prometheus-stack.fullname" $ }}-{{ $prometheusRuleName }} + name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" $) $prometheusRuleName | trunc 63 | trimSuffix "-" }} namespace: {{ template "kube-prometheus-stack.namespace" $ }} labels: app: {{ template "kube-prometheus-stack.name" $ }} @@ -27,7 +27,7 @@ items: - apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: - name: {{ template "kube-prometheus-stack.fullname" $ }}-{{ .name }} + name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" $) .name | trunc 63 | trimSuffix "-" }} namespace: {{ template "kube-prometheus-stack.namespace" $ }} labels: app: {{ template "kube-prometheus-stack.name" $ }}