From f517b35a42ced4cdec19a5c9dfb24cf9f753c6e4 Mon Sep 17 00:00:00 2001 From: omerlh <omerl@soluto.com> Date: Tue, 14 Jan 2020 17:55:27 +0200 Subject: [PATCH] added patch to allow prom to watch all namespaces --- .../kube-prometheus-all-namespaces.libsonnet | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 jsonnet/kube-prometheus/kube-prometheus-all-namespaces.libsonnet diff --git a/jsonnet/kube-prometheus/kube-prometheus-all-namespaces.libsonnet b/jsonnet/kube-prometheus/kube-prometheus-all-namespaces.libsonnet new file mode 100644 index 00000000..468420fd --- /dev/null +++ b/jsonnet/kube-prometheus/kube-prometheus-all-namespaces.libsonnet @@ -0,0 +1,20 @@ +local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet'; + +{ + prometheus+:: { + clusterRole+: { + rules+: + local role = k.rbac.v1.role; + local policyRule = role.rulesType; + local rule = policyRule.new() + + policyRule.withApiGroups(['']) + + policyRule.withResources([ + 'services', + 'endpoints', + 'pods', + ]) + + policyRule.withVerbs(['get', 'list', 'watch']); + [rule] + }, + } +} \ No newline at end of file -- GitLab