1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-16 09:16:38 +00:00
prometheus-operator/contrib/kube-prometheus/jsonnet/kube-state-metrics/kube-state-metrics-role-binding.libsonnet
Brandon Dimcheff 8e00a1c15d kube-prometheus: fix addon-resizer role binding
The addon resizer was referring to an incorrect role binding and was unable to
access the API.  This changes the rolebinding name to refer to the correctly
defined rolebinding.
2018-04-25 22:05:56 -04:00

13 lines
586 B
Jsonnet

local k = import "ksonnet.beta.3/k.libsonnet";
local roleBinding = k.rbac.v1.roleBinding;
{
new(namespace)::
roleBinding.new() +
roleBinding.mixin.metadata.withName("kube-state-metrics") +
roleBinding.mixin.metadata.withNamespace(namespace) +
roleBinding.mixin.roleRef.withApiGroup("rbac.authorization.k8s.io") +
roleBinding.mixin.roleRef.withName("kube-state-metrics") +
roleBinding.mixin.roleRef.mixinInstance({kind: "Role"}) +
roleBinding.withSubjects([{kind: "ServiceAccount", name: "kube-state-metrics"}])
}