diff --git a/docs/monitoring-other-namespaces.md b/docs/monitoring-other-namespaces.md index 2e5289c49636dfdd9d2b085c6ba0b553d60d9e9f..8327ed024b31b2da6afbcdf0ab0fb84738232404 100644 --- a/docs/monitoring-other-namespaces.md +++ b/docs/monitoring-other-namespaces.md @@ -5,7 +5,7 @@ This guide will help you monitor applications in other Namespaces. By default th You have to give the list of the Namespaces that you want to be able to monitor. This is done in the variable `prometheus.roleSpecificNamespaces`. You usually set this in your `.jsonnet` file when building the manifests. -Ex to create the needed `Role` and `Rolebindig` for the Namespace `foo` : +Example to create the needed `Role` and `Rolebindig` for the Namespace `foo` : ``` local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + { _config+:: { diff --git a/jsonnet/kube-prometheus/prometheus/prometheus.libsonnet b/jsonnet/kube-prometheus/prometheus/prometheus.libsonnet index 330a022e18e45dfee37a273902ae290733dabbbf..026acad04508cc97b92b75a3cac0cfeab4163591 100644 --- a/jsonnet/kube-prometheus/prometheus/prometheus.libsonnet +++ b/jsonnet/kube-prometheus/prometheus/prometheus.libsonnet @@ -56,7 +56,7 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; groups: $._config.prometheus.rules.groups, }, }, - roleBindingSpecificNamespace: + roleBindingSpecificNamespaces: local roleBinding = k.rbac.v1.roleBinding; local newSpecificRoleBinding(namespace) = @@ -122,7 +122,7 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; clusterRoleBinding.mixin.roleRef.withName('prometheus-' + $._config.prometheus.name) + clusterRoleBinding.mixin.roleRef.mixinInstance({ kind: 'ClusterRole' }) + clusterRoleBinding.withSubjects([{ kind: 'ServiceAccount', name: 'prometheus-' + $._config.prometheus.name, namespace: $._config.namespace }]), - roleSpecificNamespace: + roleSpecificNamespaces: local role = k.rbac.v1.role; local policyRule = role.rulesType; local coreRule = policyRule.new() +