Skip to content

Commit ec52ff4

Browse files
[kube-prometheus-stack] Add custom CI actions (#4065)
* [kube-prometheus-stack] Add custom CI actions Signed-off-by: Jan-Otto Kröpke <[email protected]> * Apply suggestions from code review Co-authored-by: Gabriel Martinez <[email protected]> Signed-off-by: Jan-Otto Kröpke <[email protected]> --------- Signed-off-by: Jan-Otto Kröpke <[email protected]> Signed-off-by: Jan-Otto Kröpke <[email protected]> Co-authored-by: Gabriel Martinez <[email protected]>
1 parent 92c39c7 commit ec52ff4

File tree

4 files changed

+43
-5
lines changed

4 files changed

+43
-5
lines changed

charts/kube-prometheus-stack/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ name: kube-prometheus-stack
2121
sources:
2222
- https://github.com/prometheus-community/helm-charts
2323
- https://github.com/prometheus-operator/kube-prometheus
24-
version: 55.0.0
24+
version: 55.0.1
2525
appVersion: v0.70.0
2626
kubeVersion: ">=1.19.0-0"
2727
home: https://github.com/prometheus-operator/kube-prometheus
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
6+
7+
cd "${SCRIPT_DIR}/../"
8+
9+
./hack/update_crds.sh
10+
if ! git diff --exit-code; then
11+
echo "Please run ./hack/update_crds.sh"
12+
exit 1
13+
fi
14+
15+
python3 -m venv venv
16+
source venv/bin/activate
17+
pip3 install -r hack/requirements.txt
18+
19+
go install -a github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest
20+
export PATH="$(go env GOPATH)/bin:$PATH"
21+
22+
./hack/sync_prometheus_rules.py
23+
if ! git diff --exit-code; then
24+
echo "Changes inside rules are not supported!"
25+
echo "Please run ./hack/sync_prometheus_rules.py"
26+
exit 1
27+
fi
28+
29+
./hack/sync_grafana_dashboards.py
30+
if ! git diff --exit-code; then
31+
echo "Changes inside dashboards are not supported!"
32+
echo "Please run ./hack/sync_grafana_dashboards.py"
33+
exit 1
34+
fi
35+
36+
rm -rf ./venv ./*.git
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
PyYAML==5.4
1+
PyYAML==6.0.1
22
requests==2.31.0
3+
jsonnet

charts/kube-prometheus-stack/hack/sync_prometheus_rules.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def new_representer(dumper, data):
7373
'min_kubernetes': '1.14.0-0',
7474
'is_mixin': True,
7575
'mixin_vars': {'_config': {
76+
'clusterLabel': 'cluster',
7677
'windowsExporterSelector': 'job="windows-exporter"',
7778
'kubeStateMetricsSelector': 'job="kube-state-metrics"',
7879
}}
@@ -509,10 +510,10 @@ def main():
509510

510511
mixin = """
511512
local kp =
512-
{ prometheusAlerts+:: {}, prometheusRules+:: {}} +
513-
(import "%s") +
513+
{ prometheusAlerts+:: {}, prometheusRules+:: {}} +
514+
(import "%s") +
514515
%s;
515-
516+
516517
kp.prometheusAlerts + kp.prometheusRules
517518
"""
518519

0 commit comments

Comments
 (0)