From 7a9f9f287352cb8f1ace6e7f80b4974165101c44 Mon Sep 17 00:00:00 2001 From: paulfantom Date: Sat, 7 Oct 2023 12:38:58 +0200 Subject: [PATCH 1/2] jsonnet: allow prometheus to get Nodes information This is necessary when using ScrapeConfig with node role --- jsonnet/kube-prometheus/components/prometheus.libsonnet | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/jsonnet/kube-prometheus/components/prometheus.libsonnet b/jsonnet/kube-prometheus/components/prometheus.libsonnet index 5532f532c1..8ff0aebcdd 100644 --- a/jsonnet/kube-prometheus/components/prometheus.libsonnet +++ b/jsonnet/kube-prometheus/components/prometheus.libsonnet @@ -214,11 +214,6 @@ function(params) { namespace:: null, }, rules: [ - { - apiGroups: [''], - resources: ['nodes/metrics'], - verbs: ['get'], - }, { nonResourceURLs: ['/metrics'], verbs: ['get'], @@ -285,7 +280,7 @@ function(params) { rules: [ { apiGroups: [''], - resources: ['services', 'endpoints', 'pods'], + resources: ['services', 'endpoints', 'pods', 'nodes'], verbs: ['get', 'list', 'watch'], }, { From 465971142877b6f92dc932d33ce2da64c07ce1a3 Mon Sep 17 00:00:00 2001 From: paulfantom Date: Sat, 7 Oct 2023 12:39:25 +0200 Subject: [PATCH 2/2] manifests: regenerate --- manifests/prometheus-clusterRole.yaml | 6 ------ manifests/prometheus-roleSpecificNamespaces.yaml | 3 +++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/manifests/prometheus-clusterRole.yaml b/manifests/prometheus-clusterRole.yaml index 499a151da2..5642e631a1 100644 --- a/manifests/prometheus-clusterRole.yaml +++ b/manifests/prometheus-clusterRole.yaml @@ -9,12 +9,6 @@ metadata: app.kubernetes.io/version: 2.47.0 name: prometheus-k8s rules: -- apiGroups: - - "" - resources: - - nodes/metrics - verbs: - - get - nonResourceURLs: - /metrics verbs: diff --git a/manifests/prometheus-roleSpecificNamespaces.yaml b/manifests/prometheus-roleSpecificNamespaces.yaml index f6ce749e16..2daa7f33b2 100644 --- a/manifests/prometheus-roleSpecificNamespaces.yaml +++ b/manifests/prometheus-roleSpecificNamespaces.yaml @@ -18,6 +18,7 @@ items: - services - endpoints - pods + - nodes verbs: - get - list @@ -56,6 +57,7 @@ items: - services - endpoints - pods + - nodes verbs: - get - list @@ -94,6 +96,7 @@ items: - services - endpoints - pods + - nodes verbs: - get - list