Add support for prometheus
[ric-plt/ric-dep.git] / helm / infrastructure / subcharts / prometheus / charts / kube-state-metrics / templates / clusterrole.yaml
1 {{- if .Values.rbac.create -}}
2 apiVersion: rbac.authorization.k8s.io/v1beta1
3 kind: ClusterRole
4 metadata:
5   labels:
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" . }}
11 rules:
12 {{ if .Values.collectors.certificatesigningrequests }}
13 - apiGroups: ["certificates.k8s.io"]
14   resources:
15   - certificatesigningrequests
16   verbs: ["list", "watch"]
17 {{ end -}}
18 {{ if .Values.collectors.configmaps }}
19 - apiGroups: [""]
20   resources:
21   - configmaps
22   verbs: ["list", "watch"]
23 {{ end -}}
24 {{ if .Values.collectors.cronjobs }}
25 - apiGroups: ["batch"]
26   resources:
27   - cronjobs
28   verbs: ["list", "watch"]
29 {{ end -}}
30 {{ if .Values.collectors.daemonsets }}
31 - apiGroups: ["extensions", "apps"]
32   resources:
33   - daemonsets
34   verbs: ["list", "watch"]
35 {{ end -}}
36 {{ if .Values.collectors.deployments }}
37 - apiGroups: ["extensions", "apps"]
38   resources:
39   - deployments
40   verbs: ["list", "watch"]
41 {{ end -}}
42 {{ if .Values.collectors.endpoints }}
43 - apiGroups: [""]
44   resources:
45   - endpoints
46   verbs: ["list", "watch"]
47 {{ end -}}
48 {{ if .Values.collectors.horizontalpodautoscalers }}
49 - apiGroups: ["autoscaling"]
50   resources:
51   - horizontalpodautoscalers
52   verbs: ["list", "watch"]
53 {{ end -}}
54 {{ if .Values.collectors.ingresses }}
55 - apiGroups: ["extensions", "networking.k8s.io"]
56   resources:
57   - ingresses
58   verbs: ["list", "watch"]
59 {{ end -}}
60 {{ if .Values.collectors.jobs }}
61 - apiGroups: ["batch"]
62   resources:
63   - jobs
64   verbs: ["list", "watch"]
65 {{ end -}}
66 {{ if .Values.collectors.limitranges }}
67 - apiGroups: [""]
68   resources:
69   - limitranges
70   verbs: ["list", "watch"]
71 {{ end -}}
72 {{ if .Values.collectors.mutatingwebhookconfigurations }}
73 - apiGroups: ["admissionregistration.k8s.io"]
74   resources:
75     - mutatingwebhookconfigurations
76   verbs: ["list", "watch"]
77 {{ end -}}
78 {{ if .Values.collectors.namespaces }}
79 - apiGroups: [""]
80   resources:
81   - namespaces
82   verbs: ["list", "watch"]
83 {{ end -}}
84 {{ if .Values.collectors.networkpolicies }}
85 - apiGroups: ["networking.k8s.io"]
86   resources:
87   - networkpolicies
88   verbs: ["list", "watch"]
89 {{ end -}}
90 {{ if .Values.collectors.nodes }}
91 - apiGroups: [""]
92   resources:
93   - nodes
94   verbs: ["list", "watch"]
95 {{ end -}}
96 {{ if .Values.collectors.persistentvolumeclaims }}
97 - apiGroups: [""]
98   resources:
99   - persistentvolumeclaims
100   verbs: ["list", "watch"]
101 {{ end -}}
102 {{ if .Values.collectors.persistentvolumes }}
103 - apiGroups: [""]
104   resources:
105   - persistentvolumes
106   verbs: ["list", "watch"]
107 {{ end -}}
108 {{ if .Values.collectors.poddisruptionbudgets }}
109 - apiGroups: ["policy"]
110   resources:
111     - poddisruptionbudgets
112   verbs: ["list", "watch"]
113 {{ end -}}
114 {{ if .Values.collectors.pods }}
115 - apiGroups: [""]
116   resources:
117   - pods
118   verbs: ["list", "watch"]
119 {{ end -}}
120 {{ if .Values.collectors.replicasets }}
121 - apiGroups: ["extensions", "apps"]
122   resources:
123   - replicasets
124   verbs: ["list", "watch"]
125 {{ end -}}
126 {{ if .Values.collectors.replicationcontrollers }}
127 - apiGroups: [""]
128   resources:
129   - replicationcontrollers
130   verbs: ["list", "watch"]
131 {{ end -}}
132 {{ if .Values.collectors.resourcequotas }}
133 - apiGroups: [""]
134   resources:
135   - resourcequotas
136   verbs: ["list", "watch"]
137 {{ end -}}
138 {{ if .Values.collectors.secrets }}
139 - apiGroups: [""]
140   resources:
141   - secrets
142   verbs: ["list", "watch"]
143 {{ end -}}
144 {{ if .Values.collectors.services }}
145 - apiGroups: [""]
146   resources:
147   - services
148   verbs: ["list", "watch"]
149 {{ end -}}
150 {{ if .Values.collectors.statefulsets }}
151 - apiGroups: ["apps"]
152   resources:
153   - statefulsets
154   verbs: ["list", "watch"]
155 {{ end -}}
156 {{ if .Values.collectors.storageclasses }}
157 - apiGroups: ["storage.k8s.io"]
158   resources:
159     - storageclasses
160   verbs: ["list", "watch"]
161 {{ end -}}
162 {{ if .Values.collectors.validatingwebhookconfigurations }}
163 - apiGroups: ["admissionregistration.k8s.io"]
164   resources:
165     - validatingwebhookconfigurations
166   verbs: ["list", "watch"]
167 {{ end -}}
168 {{ if .Values.collectors.volumeattachments }}
169 - apiGroups: ["storage.k8s.io"]
170   resources:
171     - volumeattachments
172   verbs: ["list", "watch"]
173 {{ end -}}
174 {{ if .Values.collectors.verticalpodautoscalers }}
175 - apiGroups: ["autoscaling.k8s.io"]
176   resources:
177     - verticalpodautoscalers
178   verbs: ["list", "watch"]
179 {{ end -}}
180 {{- end -}}