Skip to content

Commit

Permalink
[kube-prometheus-stack] fix CI
Browse files Browse the repository at this point in the history
Signed-off-by: Jan-Otto Kröpke <[email protected]>
  • Loading branch information
jkroepke committed Feb 23, 2024
1 parent 591bae5 commit a12f715
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
15 changes: 12 additions & 3 deletions charts/kube-prometheus-stack/hack/sync_grafana_dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,27 @@ 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',
'multicluster_key': '.Values.grafana.sidecar.dashboards.multicluster.global.enabled',
},
{
'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',
Expand All @@ -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',
Expand Down
27 changes: 18 additions & 9 deletions charts/kube-prometheus-stack/hack/sync_prometheus_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down

0 comments on commit a12f715

Please sign in to comment.