From a12f715a9b599727cdf0b52f0f16a7d05d4ffb66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Fri, 23 Feb 2024 19:54:16 +0100 Subject: [PATCH] [kube-prometheus-stack] fix CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan-Otto Kröpke --- .../hack/sync_grafana_dashboards.py | 15 ++++++++--- .../hack/sync_prometheus_rules.py | 27 ++++++++++++------- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/charts/kube-prometheus-stack/hack/sync_grafana_dashboards.py b/charts/kube-prometheus-stack/hack/sync_grafana_dashboards.py index e803bf51e66f..36e285f41826 100755 --- a/charts/kube-prometheus-stack/hack/sync_grafana_dashboards.py +++ b/charts/kube-prometheus-stack/hack/sync_grafana_dashboards.py @@ -27,10 +27,19 @@ def new_representer(dumper, data): return new_representer +refs = { + # https://github.com/prometheus-operator/kube-prometheus + 'kube-prometheus': 'a8ba97a150c75be42010c75d10b720c55e182f1a', + # https://github.com/kubernetes-monitoring/kubernetes-mixin + 'kubernetes-mixin': '883f294bc636e2cd019a64328a1dbfa53edbc985', + # https://github.com/etcd-io/etcd + 'etcd': '2e7ed80be246380fc50ca46aa193348a28935380', +} + # Source files list charts = [ { - 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/a8ba97a150c75be42010c75d10b720c55e182f1a/manifests/grafana-dashboardDefinitions.yaml', + 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/%s/manifests/grafana-dashboardDefinitions.yaml' % (refs['kube-prometheus'],), 'destination': '../templates/grafana/dashboards-1.14', 'type': 'yaml', 'min_kubernetes': '1.14.0-0', @@ -38,7 +47,7 @@ def new_representer(dumper, data): }, { 'git': 'https://github.com/kubernetes-monitoring/kubernetes-mixin.git', - 'branch': '883f294bc636e2cd019a64328a1dbfa53edbc985', + 'branch': refs['kubernetes-mixin'], 'content': "(import 'dashboards/windows.libsonnet') + (import 'config.libsonnet') + { _config+:: { windowsExporterSelector: 'job=\"windows-exporter\"', }}", 'cwd': '.', 'destination': '../templates/grafana/dashboards-1.14', @@ -49,7 +58,7 @@ def new_representer(dumper, data): }, { 'git': 'https://github.com/etcd-io/etcd.git', - 'branch': '2e7ed80be246380fc50ca46aa193348a28935380', + 'branch': refs['etcd'], 'source': 'mixin.libsonnet', 'cwd': 'contrib/mixin', 'destination': '../templates/grafana/dashboards-1.14', diff --git a/charts/kube-prometheus-stack/hack/sync_prometheus_rules.py b/charts/kube-prometheus-stack/hack/sync_prometheus_rules.py index 41128bf37543..441873b5ec80 100755 --- a/charts/kube-prometheus-stack/hack/sync_prometheus_rules.py +++ b/charts/kube-prometheus-stack/hack/sync_prometheus_rules.py @@ -27,46 +27,55 @@ def new_representer(dumper, data): return new_representer +refs = { + # https://github.com/prometheus-operator/kube-prometheus + 'kube-prometheus': 'a8ba97a150c75be42010c75d10b720c55e182f1a', + # https://github.com/kubernetes-monitoring/kubernetes-mixin + 'kubernetes-mixin': '883f294bc636e2cd019a64328a1dbfa53edbc985', + # https://github.com/etcd-io/etcd + 'etcd': '2e7ed80be246380fc50ca46aa193348a28935380', +} + # Source files list charts = [ { - 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/alertmanager-prometheusRule.yaml', + 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/%s/manifests/alertmanager-prometheusRule.yaml' % (refs['kube-prometheus'],), 'destination': '../templates/prometheus/rules-1.14', 'min_kubernetes': '1.14.0-0' }, { - 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/kubePrometheus-prometheusRule.yaml', + 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/%s/manifests/kubePrometheus-prometheusRule.yaml'% (refs['kube-prometheus'],), 'destination': '../templates/prometheus/rules-1.14', 'min_kubernetes': '1.14.0-0' }, { - 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/kubernetesControlPlane-prometheusRule.yaml', + 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/%s/manifests/kubernetesControlPlane-prometheusRule.yaml'% (refs['kube-prometheus'],), 'destination': '../templates/prometheus/rules-1.14', 'min_kubernetes': '1.14.0-0' }, { - 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/kubeStateMetrics-prometheusRule.yaml', + 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/%s/manifests/kubeStateMetrics-prometheusRule.yaml'% (refs['kube-prometheus'],), 'destination': '../templates/prometheus/rules-1.14', 'min_kubernetes': '1.14.0-0' }, { - 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/nodeExporter-prometheusRule.yaml', + 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/%s/manifests/nodeExporter-prometheusRule.yaml'% (refs['kube-prometheus'],), 'destination': '../templates/prometheus/rules-1.14', 'min_kubernetes': '1.14.0-0' }, { - 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/prometheus-prometheusRule.yaml', + 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/%s/manifests/prometheus-prometheusRule.yaml'% (refs['kube-prometheus'],), 'destination': '../templates/prometheus/rules-1.14', 'min_kubernetes': '1.14.0-0' }, { - 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/prometheusOperator-prometheusRule.yaml', + 'source': 'https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/%s/manifests/prometheusOperator-prometheusRule.yaml'% (refs['kube-prometheus'],), 'destination': '../templates/prometheus/rules-1.14', 'min_kubernetes': '1.14.0-0' }, { 'git': 'https://github.com/kubernetes-monitoring/kubernetes-mixin.git', - 'branch': 'master', + 'branch': refs['kubernetes-mixin'], 'source': 'windows.libsonnet', 'cwd': 'rules', 'destination': '../templates/prometheus/rules-1.14', @@ -80,7 +89,7 @@ def new_representer(dumper, data): }, { 'git': 'https://github.com/etcd-io/etcd.git', - 'source': 'mixin.libsonnet', + 'source': refs['etcd'], 'cwd': 'contrib/mixin', 'destination': '../templates/prometheus/rules-1.14', 'min_kubernetes': '1.14.0-0',