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