mirror of
				https://github.com/prometheus-operator/kube-prometheus.git
				synced 2025-10-31 08:01:32 +01:00 
			
		
		
		
	Change the roleBinding and rules names too
This commit is contained in:
		
							parent
							
								
									da6fc256b5
								
							
						
					
					
						commit
						23cd630d33
					
				| @ -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'; | |||||||
|                             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: | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user