From 920379f9ca81f72b63741e2a6d59dc989ef80c1b Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Thu, 2 Nov 2023 01:59:13 +0100 Subject: [PATCH] Added cluster role and role binding to allow access to metrics endpoints --- argocd/prometheus/test/templates/cr.yaml | 12 ++++++++++++ argocd/prometheus/test/templates/crb.yaml | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 argocd/prometheus/test/templates/cr.yaml create mode 100644 argocd/prometheus/test/templates/crb.yaml diff --git a/argocd/prometheus/test/templates/cr.yaml b/argocd/prometheus/test/templates/cr.yaml new file mode 100644 index 0000000..9acadbb --- /dev/null +++ b/argocd/prometheus/test/templates/cr.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: prometheus-metrics-reading +rules: + - nonResourceURLs: + - "/metrics" + - "/metrics/cadvisor" + - "/metrics/resource" + - "/metrics/probes" + verbs: + - get \ No newline at end of file diff --git a/argocd/prometheus/test/templates/crb.yaml b/argocd/prometheus/test/templates/crb.yaml new file mode 100644 index 0000000..ca8c426 --- /dev/null +++ b/argocd/prometheus/test/templates/crb.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: prometheus-metrics-reading +subjects: + - kind: ServiceAccount + apiGroup: rbac.authorization.k8s.io + name: prometheus-server +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: prometheus-metrics-reading