1 {{- if .Values.rbac.create -}}
2 apiVersion: rbac.authorization.k8s.io/v1beta1
6 app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
7 helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
8 app.kubernetes.io/managed-by: {{ .Release.Service }}
9 app.kubernetes.io/instance: {{ .Release.Name }}
10 name: {{ template "kube-state-metrics.fullname" . }}
12 {{ if .Values.collectors.certificatesigningrequests }}
13 - apiGroups: ["certificates.k8s.io"]
15 - certificatesigningrequests
16 verbs: ["list", "watch"]
18 {{ if .Values.collectors.configmaps }}
22 verbs: ["list", "watch"]
24 {{ if .Values.collectors.cronjobs }}
25 - apiGroups: ["batch"]
28 verbs: ["list", "watch"]
30 {{ if .Values.collectors.daemonsets }}
31 - apiGroups: ["extensions", "apps"]
34 verbs: ["list", "watch"]
36 {{ if .Values.collectors.deployments }}
37 - apiGroups: ["extensions", "apps"]
40 verbs: ["list", "watch"]
42 {{ if .Values.collectors.endpoints }}
46 verbs: ["list", "watch"]
48 {{ if .Values.collectors.horizontalpodautoscalers }}
49 - apiGroups: ["autoscaling"]
51 - horizontalpodautoscalers
52 verbs: ["list", "watch"]
54 {{ if .Values.collectors.ingresses }}
55 - apiGroups: ["extensions", "networking.k8s.io"]
58 verbs: ["list", "watch"]
60 {{ if .Values.collectors.jobs }}
61 - apiGroups: ["batch"]
64 verbs: ["list", "watch"]
66 {{ if .Values.collectors.limitranges }}
70 verbs: ["list", "watch"]
72 {{ if .Values.collectors.mutatingwebhookconfigurations }}
73 - apiGroups: ["admissionregistration.k8s.io"]
75 - mutatingwebhookconfigurations
76 verbs: ["list", "watch"]
78 {{ if .Values.collectors.namespaces }}
82 verbs: ["list", "watch"]
84 {{ if .Values.collectors.networkpolicies }}
85 - apiGroups: ["networking.k8s.io"]
88 verbs: ["list", "watch"]
90 {{ if .Values.collectors.nodes }}
94 verbs: ["list", "watch"]
96 {{ if .Values.collectors.persistentvolumeclaims }}
99 - persistentvolumeclaims
100 verbs: ["list", "watch"]
102 {{ if .Values.collectors.persistentvolumes }}
106 verbs: ["list", "watch"]
108 {{ if .Values.collectors.poddisruptionbudgets }}
109 - apiGroups: ["policy"]
111 - poddisruptionbudgets
112 verbs: ["list", "watch"]
114 {{ if .Values.collectors.pods }}
118 verbs: ["list", "watch"]
120 {{ if .Values.collectors.replicasets }}
121 - apiGroups: ["extensions", "apps"]
124 verbs: ["list", "watch"]
126 {{ if .Values.collectors.replicationcontrollers }}
129 - replicationcontrollers
130 verbs: ["list", "watch"]
132 {{ if .Values.collectors.resourcequotas }}
136 verbs: ["list", "watch"]
138 {{ if .Values.collectors.secrets }}
142 verbs: ["list", "watch"]
144 {{ if .Values.collectors.services }}
148 verbs: ["list", "watch"]
150 {{ if .Values.collectors.statefulsets }}
151 - apiGroups: ["apps"]
154 verbs: ["list", "watch"]
156 {{ if .Values.collectors.storageclasses }}
157 - apiGroups: ["storage.k8s.io"]
160 verbs: ["list", "watch"]
162 {{ if .Values.collectors.validatingwebhookconfigurations }}
163 - apiGroups: ["admissionregistration.k8s.io"]
165 - validatingwebhookconfigurations
166 verbs: ["list", "watch"]
168 {{ if .Values.collectors.volumeattachments }}
169 - apiGroups: ["storage.k8s.io"]
172 verbs: ["list", "watch"]
174 {{ if .Values.collectors.verticalpodautoscalers }}
175 - apiGroups: ["autoscaling.k8s.io"]
177 - verticalpodautoscalers
178 verbs: ["list", "watch"]