Skip to content
Snippets Groups Projects
Commit 23cd630d authored by Matthias Loibl's avatar Matthias Loibl
Browse files

Change the roleBinding and rules names too

parent da6fc256
Branches
Tags
No related merge requests found
...@@ -42,7 +42,7 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; ...@@ -42,7 +42,7 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet';
rules: rules:
local configMap = k.core.v1.configMap; local configMap = k.core.v1.configMap;
configMap.new('prometheus-k8s-rules', ({ 'all.rules.yaml': std.manifestYamlDoc($._config.prometheus.rules) } + $._config.prometheus.renderedRules)) + configMap.new('prometheus-' + $._config.prometheus.name + '-rules', ({ 'all.rules.yaml': std.manifestYamlDoc($._config.prometheus.rules) } + $._config.prometheus.renderedRules)) +
configMap.mixin.metadata.withLabels({ role: 'alert-rules', prometheus: $._config.prometheus.name }) + configMap.mixin.metadata.withLabels({ role: 'alert-rules', prometheus: $._config.prometheus.name }) +
configMap.mixin.metadata.withNamespace($._config.namespace), configMap.mixin.metadata.withNamespace($._config.namespace),
roleBindingDefault: roleBindingDefault:
...@@ -85,17 +85,17 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; ...@@ -85,17 +85,17 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet';
policyRule.withVerbs(['get']); policyRule.withVerbs(['get']);
role.new() + role.new() +
role.mixin.metadata.withName('prometheus-k8s-config') + role.mixin.metadata.withName('prometheus-' + $._config.prometheus.name + '-config') +
role.mixin.metadata.withNamespace($._config.namespace) + role.mixin.metadata.withNamespace($._config.namespace) +
role.withRules(configmapRule), role.withRules(configmapRule),
roleBindingConfig: roleBindingConfig:
local roleBinding = k.rbac.v1.roleBinding; local roleBinding = k.rbac.v1.roleBinding;
roleBinding.new() + roleBinding.new() +
roleBinding.mixin.metadata.withName('prometheus-k8s-config') + roleBinding.mixin.metadata.withName('prometheus-' + $._config.prometheus.name + '-config') +
roleBinding.mixin.metadata.withNamespace($._config.namespace) + roleBinding.mixin.metadata.withNamespace($._config.namespace) +
roleBinding.mixin.roleRef.withApiGroup('rbac.authorization.k8s.io') + roleBinding.mixin.roleRef.withApiGroup('rbac.authorization.k8s.io') +
roleBinding.mixin.roleRef.withName('prometheus-k8s-config') + roleBinding.mixin.roleRef.withName('prometheus-' + $._config.prometheus.name + '-config') +
roleBinding.mixin.roleRef.mixinInstance({ kind: 'Role' }) + roleBinding.mixin.roleRef.mixinInstance({ kind: 'Role' }) +
roleBinding.withSubjects([{ kind: 'ServiceAccount', name: 'prometheus-' + $._config.prometheus.name, namespace: $._config.namespace }]), roleBinding.withSubjects([{ kind: 'ServiceAccount', name: 'prometheus-' + $._config.prometheus.name, namespace: $._config.namespace }]),
roleBindingNamespace: roleBindingNamespace:
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment