Revert "fix prometheus"

This reverts commit a3d3dd8336.
This commit is contained in:
2025-03-30 19:34:16 +02:00
parent 088c534cde
commit d86d651c4f
5 changed files with 15 additions and 26 deletions

View File

@@ -9,7 +9,7 @@ local kp = (import 'kube-prometheus/main.libsonnet') + {
// Disable the built-in Grafana component
grafana+:: {},
// Prometheus customizations: external URL, persistent storage, and self-scrape enabled
// Prometheus customizations: external URL and persistent storage
prometheus+:: {
prometheus+: {
spec+: {
@@ -24,22 +24,6 @@ local kp = (import 'kube-prometheus/main.libsonnet') + {
},
},
},
// Enable self-scraping so Prometheus will automatically scrape its own /metrics endpoint
selfScrape: true,
// Set a ServiceMonitor selector that matches the Prometheus service's labels
serviceMonitorSelector: {
matchLabels: {
"k8s-app": "prometheus",
},
},
},
},
// Ensure the Prometheus service gets the label so that the selector above matches it
service+: {
metadata+: {
labels: {
"k8s-app": "prometheus",
},
},
},
},
@@ -143,4 +127,4 @@ local kp = (import 'kube-prometheus/main.libsonnet') + {
{ ['node-exporter-' + name]: kp.nodeExporter[name] for name in std.objectFields(kp.nodeExporter) } +
{ ['prometheus-' + name]: kp.prometheus[name] for name in std.objectFields(kp.prometheus) } +
{ ['prometheus-adapter-' + name]: kp.prometheusAdapter[name] for name in std.objectFields(kp.prometheusAdapter) } +
{ [name + '-ingress']: kp.ingress[name] for name in std.objectFields(kp.ingress) }
{ [name + '-ingress']: kp.ingress[name] for name in std.objectFields(kp.ingress) }