From 4b7717d07acbd4b583df708fb8721b53f4a06395 Mon Sep 17 00:00:00 2001 From: Finn Date: Wed, 10 Jul 2024 20:18:39 -0700 Subject: [PATCH] allow prom to scrape services and endpoints --- k8s/monitoring/scrape-configs.yaml | 4 ++++ k8s/operators/kube-prometheus/cluster-role-patch.yaml | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/k8s/monitoring/scrape-configs.yaml b/k8s/monitoring/scrape-configs.yaml index 45d60e2..148f7ad 100644 --- a/k8s/monitoring/scrape-configs.yaml +++ b/k8s/monitoring/scrape-configs.yaml @@ -14,6 +14,10 @@ action: replace target_label: __metrics_path__ regex: (.+) + - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scheme] + action: replace + target_label: __scheme__ + regex: (.+) - action: labelmap regex: __meta_kubernetes_pod_label_(.+) - source_labels: [__meta_kubernetes_namespace] diff --git a/k8s/operators/kube-prometheus/cluster-role-patch.yaml b/k8s/operators/kube-prometheus/cluster-role-patch.yaml index bebdefe..b84f8d4 100644 --- a/k8s/operators/kube-prometheus/cluster-role-patch.yaml +++ b/k8s/operators/kube-prometheus/cluster-role-patch.yaml @@ -2,5 +2,5 @@ path: /rules/- value: apiGroups: [""] - resources: [pods] - verbs: [list, get, watch] + resources: [pods, services, endpoints] + verbs: [list, watch]