Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kube-state-metrics]: Configurable extra rules for KSM ClusterRole #2249

Merged
2 changes: 1 addition & 1 deletion charts/kube-state-metrics/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords:
- prometheus
- kubernetes
type: application
version: 4.12.0
version: 4.13.0
appVersion: 2.5.0
home: https://github.com/kubernetes/kube-state-metrics/
sources:
Expand Down
3 changes: 3 additions & 0 deletions charts/kube-state-metrics/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,8 @@ rules:
- verticalpodautoscalers
verbs: ["list", "watch"]
{{ end -}}
{{ if $.Values.rbac.extraRules }}
{{ toYaml $.Values.rbac.extraRules }}
{{ end }}
{{- end -}}
{{- end -}}
7 changes: 7 additions & 0 deletions charts/kube-state-metrics/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ rbac:
# If set to false - Run without Cluteradmin privs needed - ONLY works if namespace is also set (if useExistingRole is set this name is used as ClusterRole or Role to bind to)
useClusterRole: true

# Add permissions for CustomResources' apiGroups in Role/ClusterRole. Should be used in conjunction with Custom Resource State Metrics configuration
# Example:
# - apiGroups: ["monitoring.coreos.com"]
# resources: ["prometheuses"]
# verbs: ["list", "watch"]
extraRules: []

serviceAccount:
# Specifies whether a ServiceAccount should be created, require rbac true
create: true
Expand Down