Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-flock / stx-monitor-armada-app / monitor-helm / 0010-Update-kube-state-metrics-1.8.0-to-commit-09daf19.patch
1 From 3f950814b953c6806100404f5e43bd16ce86f6fd Mon Sep 17 00:00:00 2001
2 From: John Kung <john.kung@windriver.com>
3 Date: Fri, 18 Oct 2019 17:01:14 -0400
4 Subject: [PATCH 1/1] Update kube-state-metrics 1.8.0, to commit 09daf19
5
6 ---
7  stable/kube-state-metrics/Chart.yaml               |  7 +-
8  stable/kube-state-metrics/OWNERS                   |  8 ++
9  stable/kube-state-metrics/README.md                | 96 ++++++++++++----------
10  stable/kube-state-metrics/templates/NOTES.txt      |  2 +-
11  .../kube-state-metrics/templates/clusterrole.yaml  | 38 +++++++--
12  .../templates/clusterrolebinding.yaml              |  8 +-
13  .../kube-state-metrics/templates/deployment.yaml   | 52 +++++++++---
14  .../templates/podsecuritypolicy.yaml               | 10 +--
15  .../templates/psp-clusterrole.yaml                 |  8 +-
16  .../templates/psp-clusterrolebinding.yaml          |  8 +-
17  stable/kube-state-metrics/templates/service.yaml   | 22 +++--
18  .../templates/serviceaccount.yaml                  | 10 +--
19  .../templates/servicemonitor.yaml                  | 24 ++++++
20  stable/kube-state-metrics/values.yaml              | 24 +++++-
21  14 files changed, 220 insertions(+), 97 deletions(-)
22  create mode 100644 stable/kube-state-metrics/OWNERS
23  create mode 100644 stable/kube-state-metrics/templates/servicemonitor.yaml
24
25 diff --git a/stable/kube-state-metrics/Chart.yaml b/stable/kube-state-metrics/Chart.yaml
26 index 2f0f39d..283e1ac 100644
27 --- a/stable/kube-state-metrics/Chart.yaml
28 +++ b/stable/kube-state-metrics/Chart.yaml
29 @@ -5,11 +5,14 @@ keywords:
30  - metric
31  - monitoring
32  - prometheus
33 -version: 0.16.0
34 -appVersion: 1.5.0
35 +- kubernetes
36 +version: 2.4.1
37 +appVersion: 1.8.0
38  home: https://github.com/kubernetes/kube-state-metrics/
39  sources:
40  - https://github.com/kubernetes/kube-state-metrics/
41  maintainers:
42  - name: fiunchinho
43    email: jose@armesto.net
44 +- name: tariq1890
45 +  email: tariq.ibrahim@mulesoft.com
46 diff --git a/stable/kube-state-metrics/OWNERS b/stable/kube-state-metrics/OWNERS
47 new file mode 100644
48 index 0000000..6ffd97d
49 --- /dev/null
50 +++ b/stable/kube-state-metrics/OWNERS
51 @@ -0,0 +1,8 @@
52 +approvers:
53 +- fiunchinho
54 +- tariq1890
55 +- mrueg
56 +reviewers:
57 +- fiunchinho
58 +- tariq1890
59 +- mrueg
60 diff --git a/stable/kube-state-metrics/README.md b/stable/kube-state-metrics/README.md
61 index 94ad049..6c7f364 100644
62 --- a/stable/kube-state-metrics/README.md
63 +++ b/stable/kube-state-metrics/README.md
64 @@ -12,45 +12,57 @@ $ helm install stable/kube-state-metrics
65  
66  ## Configuration
67  
68 -| Parameter                             | Description                                             | Default                                     |
69 -|---------------------------------------|---------------------------------------------------------|---------------------------------------------|
70 -| `image.repository`                    | The image repository to pull from                       | k8s.gcr.io/kube-state-metrics               |
71 -| `image.tag`                           | The image tag to pull from                              | `v1.5.0`                                    |
72 -| `image.pullPolicy`                    | Image pull policy                                       | IfNotPresent                                |
73 -| `replicas`                            | Number of replicas                                      | 1                                           |
74 -| `service.port`                        | The port of the container                               | 8080                                        |
75 -| `prometheusScrape`                    | Whether or not enable prom scrape                       | true                                        |
76 -| `rbac.create`                         | If true, create & use RBAC resources                    | true                                        |
77 -| `serviceAccount.create`               | If true, and rbac true, create & use serviceAccount     | true                                        |
78 -| `serviceAccount.name`                 | If not set & create is true, use template fullname      |                                             |
79 -| `serviceAccount.imagePullSecrets`     | Specify image pull secrets field                        | `[]`                                        |
80 -| `podSecurityPolicy.enabled`           | If true, create & use PodSecurityPolicy resources       | false                                       |
81 -| `podSecurityPolicy.annotations`       | Specify pod annotations in the pod security policy      | {}                                          |
82 -| `securityContext.enabled`             | Enable security context                                 | `true`                                      |
83 -| `securityContext.fsGroup`             | Group ID for the container                              | `65534`                                     |
84 -| `securityContext.runAsUser`           | User ID for the container                               | `65534`                                     |
85 -| `priorityClassName`                   | Name of Priority Class to assign pods                   | `nil`                                       |
86 -| `nodeSelector`                        | Node labels for pod assignment                          | {}                                          |
87 -| `tolerations`                         | Tolerations for pod assignment                             | []                                          |
88 -| `podAnnotations`                      | Annotations to be added to the pod                      | {}                                          |
89 -| `resources`                           | kube-state-metrics resource requests and limits         | {}                                          |
90 -| `collectors.configmaps`               | Enable the configmaps collector.                        | true                                        |
91 -| `collectors.cronjobs`                 | Enable the cronjobs collector.                          | true                                        |
92 -| `collectors.daemonsets`               | Enable the daemonsets collector.                        | true                                        |
93 -| `collectors.deployments`              | Enable the deployments collector.                       | true                                        |
94 -| `collectors.endpoints`                | Enable the endpoints collector.                         | true                                        |
95 -| `collectors.horizontalpodautoscalers` | Enable the horizontalpodautoscalers collector.          | true                                        |
96 -| `collectors.jobs`                     | Enable the jobs collector.                              | true                                        |
97 -| `collectors.limitranges`              | Enable the limitranges collector.                       | true                                        |
98 -| `collectors.namespaces`               | Enable the namespaces collector.                        | true                                        |
99 -| `collectors.nodes`                    | Enable the nodes collector.                             | true                                        |
100 -| `collectors.persistentvolumeclaims`   | Enable the persistentvolumeclaims collector.            | true                                        |
101 -| `collectors.persistentvolumes`        | Enable the persistentvolumes collector.                 | true                                        |
102 -| `collectors.poddisruptionbudgets`     | Enable the poddisruptionbudgets collector.              | true                                        |
103 -| `collectors.pods`                     | Enable the pods collector.                              | true                                        |
104 -| `collectors.replicasets`              | Enable the replicasets collector.                       | true                                        |
105 -| `collectors.replicationcontrollers`   | Enable the replicationcontrollers collector.            | true                                        |
106 -| `collectors.resourcequotas`           | Enable the resourcequotas collector.                    | true                                        |
107 -| `collectors.secrets`                  | Enable the secrets collector.                           | true                                        |
108 -| `collectors.services`                 | Enable the services collector.                          | true                                        |
109 -| `collectors.statefulsets`             | Enable the statefulsets collector.                      | true                                        |
110 +| Parameter                               | Description                                                                           | Default                                    |
111 +|:----------------------------------------|:--------------------------------------------------------------------------------------|:-------------------------------------------|
112 +| `image.repository`                      | The image repository to pull from                                                     | quay.io/coreos/kube-state-metrics          |
113 +| `image.tag`                             | The image tag to pull from                                                            | `v1.8.0`                                   |
114 +| `image.pullPolicy`                      | Image pull policy                                                                     | `IfNotPresent`                             |
115 +| `replicas`                              | Number of replicas                                                                    | `1`                                        |
116 +| `service.port`                          | The port of the container                                                             | `8080`                                     |
117 +| `service.annotations`                   | Annotations to be added to the service                                                | `{}`
118 +| `customLabels`                          | Custom labels to apply to service, deployment and pods                                | `{}`                                       |
119 +| `hostNetwork`                           | Whether or not to use the host network                                                | `false`                                    |
120 +| `prometheusScrape`                      | Whether or not enable prom scrape                                                     | `true`                                     |
121 +| `rbac.create`                           | If true, create & use RBAC resources                                                  | `true`                                     |
122 +| `serviceAccount.create`                 | If true, create & use serviceAccount                                                  | `true`                                     |
123 +| `serviceAccount.name`                   | If not set & create is true, use template fullname                                    |                                            |
124 +| `serviceAccount.imagePullSecrets`       | Specify image pull secrets field                                                      | `[]`                                       |
125 +| `podSecurityPolicy.enabled`             | If true, create & use PodSecurityPolicy resources                                     | `false`                                    |
126 +| `podSecurityPolicy.annotations`         | Specify pod annotations in the pod security policy                                    | {}                                         |
127 +| `securityContext.enabled`               | Enable security context                                                               | `true`                                     |
128 +| `securityContext.fsGroup`               | Group ID for the container                                                            | `65534`                                    |
129 +| `securityContext.runAsUser`             | User ID for the container                                                             | `65534`                                    |
130 +| `priorityClassName`                     | Name of Priority Class to assign pods                                                 | `nil`                                      |
131 +| `nodeSelector`                          | Node labels for pod assignment                                                        | {}                                         |
132 +| `affinity`                              | Affinity settings for pod assignment                                                  | {}                                         |
133 +| `tolerations`                           | Tolerations for pod assignment                                                        | []                                         |
134 +| `podAnnotations`                        | Annotations to be added to the pod                                                    | {}                                         |
135 +| `resources`                             | kube-state-metrics resource requests and limits                                       | {}                                         |
136 +| `collectors.certificatesigningrequests` | Enable the certificatesigningrequests collector.                                      | `true`                                     |
137 +| `collectors.configmaps`                 | Enable the configmaps collector.                                                      | `true`                                     |
138 +| `collectors.cronjobs`                   | Enable the cronjobs collector.                                                        | `true`                                     |
139 +| `collectors.daemonsets`                 | Enable the daemonsets collector.                                                      | `true`                                     |
140 +| `collectors.deployments`                | Enable the deployments collector.                                                     | `true`                                     |
141 +| `collectors.endpoints`                  | Enable the endpoints collector.                                                       | `true`                                     |
142 +| `collectors.horizontalpodautoscalers`   | Enable the horizontalpodautoscalers collector.                                        | `true`                                     |
143 +| `collectors.ingresses`                  | Enable the ingresses collector.                                                       | `true`                                     |
144 +| `collectors.jobs`                       | Enable the jobs collector.                                                            | `true`                                     |
145 +| `collectors.limitranges`                | Enable the limitranges collector.                                                     | `true`                                     |
146 +| `collectors.namespaces`                 | Enable the namespaces collector.                                                      | `true`                                     |
147 +| `collectors.nodes`                      | Enable the nodes collector.                                                           | `true`                                     |
148 +| `collectors.persistentvolumeclaims`     | Enable the persistentvolumeclaims collector.                                          | `true`                                     |
149 +| `collectors.persistentvolumes`          | Enable the persistentvolumes collector.                                               | `true`                                     |
150 +| `collectors.poddisruptionbudgets`       | Enable the poddisruptionbudgets collector.                                            | `true`                                     |
151 +| `collectors.pods`                       | Enable the pods collector.                                                            | `true`                                     |
152 +| `collectors.replicasets`                | Enable the replicasets collector.                                                     | `true`                                     |
153 +| `collectors.replicationcontrollers`     | Enable the replicationcontrollers collector.                                          | `true`                                     |
154 +| `collectors.resourcequotas`             | Enable the resourcequotas collector.                                                  | `true`                                     |
155 +| `collectors.secrets`                    | Enable the secrets collector.                                                         | `true`                                     |
156 +| `collectors.services`                   | Enable the services collector.                                                        | `true`                                     |
157 +| `collectors.statefulsets`               | Enable the statefulsets collector.                                                    | `true`                                     |
158 +| `collectors.storageclasses`             | Enable the storageclasses collector.                                                  | `true`                                     | 
159 +| `collectors.verticalpodautoscalers`     | Enable the verticalpodautoscalers collector.                                          | `false`                                    | 
160 +| `prometheus.monitor.enabled`            | Set this to `true` to create ServiceMonitor for Prometheus operator                   | `false`                                    |
161 +| `prometheus.monitor.additionalLabels`   | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | `{}`                                       |
162 +| `prometheus.monitor.namespace`          | Namespace where servicemonitor resource should be created                             | `the same namespace as kube-state-metrics` |
163 +| `prometheus.monitor.honorLabels`        | Honor metric labels                                                                   | `false`                                    |
164 diff --git a/stable/kube-state-metrics/templates/NOTES.txt b/stable/kube-state-metrics/templates/NOTES.txt
165 index 8e8d9fe..d804011 100644
166 --- a/stable/kube-state-metrics/templates/NOTES.txt
167 +++ b/stable/kube-state-metrics/templates/NOTES.txt
168 @@ -1,6 +1,6 @@
169  kube-state-metrics is a simple service that listens to the Kubernetes API server and generates metrics about the state of the objects.
170  The exposed metrics can be found here:
171 -https://github.com/kubernetes/kube-state-metrics/tree/master/Documentation#documentation.
172 +https://github.com/kubernetes/kube-state-metrics/blob/master/docs/README.md#exposed-metrics
173  
174  The metrics are exported on the HTTP endpoint /metrics on the listening port.
175  In your case, {{ template "kube-state-metrics.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}/metrics
176 diff --git a/stable/kube-state-metrics/templates/clusterrole.yaml b/stable/kube-state-metrics/templates/clusterrole.yaml
177 index 803b73b..4f68a1f 100644
178 --- a/stable/kube-state-metrics/templates/clusterrole.yaml
179 +++ b/stable/kube-state-metrics/templates/clusterrole.yaml
180 @@ -3,12 +3,18 @@ apiVersion: rbac.authorization.k8s.io/v1beta1
181  kind: ClusterRole
182  metadata:
183    labels:
184 -    app: {{ template "kube-state-metrics.name" . }}
185 -    chart: {{ .Chart.Name }}-{{ .Chart.Version }}
186 -    heritage: {{ .Release.Service }}
187 -    release: {{ .Release.Name }}
188 +    app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
189 +    helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
190 +    app.kubernetes.io/managed-by: {{ .Release.Service }}
191 +    app.kubernetes.io/instance: {{ .Release.Name }}
192    name: {{ template "kube-state-metrics.fullname" . }}
193  rules:
194 +{{ if .Values.collectors.certificatesigningrequests }}
195 +- apiGroups: ["certificates.k8s.io"]
196 +  resources:
197 +  - certificatesigningrequests
198 +  verbs: ["list", "watch"]
199 +{{ end -}}
200  {{ if .Values.collectors.configmaps }}
201  - apiGroups: [""]
202    resources:
203 @@ -22,13 +28,13 @@ rules:
204    verbs: ["list", "watch"]
205  {{ end -}}
206  {{ if .Values.collectors.daemonsets }}
207 -- apiGroups: ["extensions"]
208 +- apiGroups: ["extensions", "apps"]
209    resources:
210    - daemonsets
211    verbs: ["list", "watch"]
212  {{ end -}}
213  {{ if .Values.collectors.deployments }}
214 -- apiGroups: ["extensions"]
215 +- apiGroups: ["extensions", "apps"]
216    resources:
217    - deployments
218    verbs: ["list", "watch"]
219 @@ -45,6 +51,12 @@ rules:
220    - horizontalpodautoscalers
221    verbs: ["list", "watch"]
222  {{ end -}}
223 +{{ if .Values.collectors.ingresses }}
224 +- apiGroups: ["extensions", "networking.k8s.io"]
225 +  resources:
226 +  - ingresses
227 +  verbs: ["list", "watch"]
228 +{{ end -}}
229  {{ if .Values.collectors.jobs }}
230  - apiGroups: ["batch"]
231    resources:
232 @@ -94,7 +106,7 @@ rules:
233    verbs: ["list", "watch"]
234  {{ end -}}
235  {{ if .Values.collectors.replicasets }}
236 -- apiGroups: ["extensions"]
237 +- apiGroups: ["extensions", "apps"]
238    resources:
239    - replicasets
240    verbs: ["list", "watch"]
241 @@ -129,4 +141,16 @@ rules:
242    - statefulsets
243    verbs: ["list", "watch"]
244  {{ end -}}
245 +{{ if .Values.collectors.storageclasses }}
246 +- apiGroups: ["storage.k8s.io"]
247 +  resources:
248 +    - storageclasses
249 +  verbs: ["list", "watch"]
250 +{{ end -}}
251 +{{ if .Values.collectors.verticalpodautoscalers }}
252 +- apiGroups: ["autoscaling.k8s.io"]
253 +  resources:
254 +    - verticalpodautoscalers
255 +  verbs: ["list", "watch"]
256 +{{ end -}}
257  {{- end -}}
258 diff --git a/stable/kube-state-metrics/templates/clusterrolebinding.yaml b/stable/kube-state-metrics/templates/clusterrolebinding.yaml
259 index e57b051..b4586fb 100644
260 --- a/stable/kube-state-metrics/templates/clusterrolebinding.yaml
261 +++ b/stable/kube-state-metrics/templates/clusterrolebinding.yaml
262 @@ -3,10 +3,10 @@ apiVersion: rbac.authorization.k8s.io/v1beta1
263  kind: ClusterRoleBinding
264  metadata:
265    labels:
266 -    app: {{ template "kube-state-metrics.name" . }}
267 -    chart: {{ .Chart.Name }}-{{ .Chart.Version }}
268 -    heritage: {{ .Release.Service }}
269 -    release: {{ .Release.Name }}
270 +    app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
271 +    helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
272 +    app.kubernetes.io/managed-by: {{ .Release.Service }}
273 +    app.kubernetes.io/instance: {{ .Release.Name }}
274    name: {{ template "kube-state-metrics.fullname" . }}
275  roleRef:
276    apiGroup: rbac.authorization.k8s.io
277 diff --git a/stable/kube-state-metrics/templates/deployment.yaml b/stable/kube-state-metrics/templates/deployment.yaml
278 index ce02f8e..492df24 100644
279 --- a/stable/kube-state-metrics/templates/deployment.yaml
280 +++ b/stable/kube-state-metrics/templates/deployment.yaml
281 @@ -3,28 +3,33 @@ kind: Deployment
282  metadata:
283    name: {{ template "kube-state-metrics.fullname" . }}
284    labels:
285 -    app: {{ template "kube-state-metrics.name" . }}
286 -    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
287 -    release: "{{ .Release.Name }}"
288 -    heritage: "{{ .Release.Service }}"
289 +    app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
290 +    helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
291 +    app.kubernetes.io/instance: "{{ .Release.Name }}"
292 +    app.kubernetes.io/managed-by: "{{ .Release.Service }}"
293 +{{- if .Values.customLabels }}
294 +{{ toYaml .Values.customLabels | indent 4 }}
295 +{{- end }}
296  spec:
297    selector:
298      matchLabels:
299 -      app: {{ template "kube-state-metrics.name" . }}
300 +      app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
301    replicas: {{ .Values.replicas }}
302    template:
303      metadata:
304        labels:
305 -        app: {{ template "kube-state-metrics.name" . }}
306 -        release: "{{ .Release.Name }}"
307 +        app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
308 +        app.kubernetes.io/instance: "{{ .Release.Name }}"
309 +{{- if .Values.customLabels }}
310 +{{ toYaml .Values.customLabels | indent 8 }}
311 +{{- end }}
312  {{- if .Values.podAnnotations }}
313        annotations:
314  {{ toYaml .Values.podAnnotations | indent 8 }}
315  {{- end }}
316      spec:
317 -{{ if .Values.rbac.create }}
318 +      hostNetwork: {{ .Values.hostNetwork }}
319        serviceAccountName: {{ template "kube-state-metrics.serviceAccountName" . }}
320 -{{ end }}
321        {{- if .Values.securityContext.enabled }}
322        securityContext:
323          fsGroup: {{ .Values.securityContext.fsGroup }}
324 @@ -36,6 +41,9 @@ spec:
325        containers:
326        - name: {{ .Chart.Name }}
327          args:
328 +{{  if .Values.collectors.certificatesigningrequests  }}
329 +        - --collectors=certificatesigningrequests
330 +{{  end  }}
331  {{  if .Values.collectors.configmaps  }}
332          - --collectors=configmaps
333  {{  end  }}
334 @@ -54,6 +62,9 @@ spec:
335  {{  if .Values.collectors.horizontalpodautoscalers  }}
336          - --collectors=horizontalpodautoscalers
337  {{  end  }}
338 +{{  if .Values.collectors.ingresses  }}
339 +        - --collectors=ingresses
340 +{{  end  }}
341  {{  if .Values.collectors.jobs  }}
342          - --collectors=jobs
343  {{  end  }}
344 @@ -96,6 +107,12 @@ spec:
345  {{  if .Values.collectors.statefulsets  }}
346          - --collectors=statefulsets
347  {{  end  }}
348 +{{  if .Values.collectors.storageclasses  }}
349 +        - --collectors=storageclasses
350 +{{  end  }}
351 +{{  if .Values.collectors.verticalpodautoscalers  }}
352 +        - --collectors=verticalpodautoscalers
353 +{{  end  }}
354  {{ if .Values.namespace }}
355          - --namespace={{ .Values.namespace }}
356  {{ end }}
357 @@ -103,14 +120,26 @@ spec:
358          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
359          ports:
360          - containerPort: 8080
361 -        readinessProbe:
362 +        livenessProbe:
363            httpGet:
364              path: /healthz
365              port: 8080
366            initialDelaySeconds: 5
367            timeoutSeconds: 5
368 +        readinessProbe:
369 +          httpGet:
370 +            path: /
371 +            port: 8080
372 +          initialDelaySeconds: 5
373 +          timeoutSeconds: 5
374 +{{- if .Values.resources }}
375          resources:
376 -{{ toYaml .Values.resources | indent 12 }}
377 +{{ toYaml .Values.resources | indent 10 }}
378 +{{- end }}
379 +{{- if .Values.affinity }}
380 +      affinity:
381 +{{ toYaml .Values.affinity | indent 8 }}
382 +{{- end }}
383  {{- if .Values.nodeSelector }}
384        nodeSelector:
385  {{ toYaml .Values.nodeSelector | indent 8 }}
386 @@ -119,4 +148,3 @@ spec:
387        tolerations:
388  {{ toYaml .Values.tolerations | indent 8 }}
389  {{- end }}
390 -
391 diff --git a/stable/kube-state-metrics/templates/podsecuritypolicy.yaml b/stable/kube-state-metrics/templates/podsecuritypolicy.yaml
392 index 4ca46ac..aeff117 100644
393 --- a/stable/kube-state-metrics/templates/podsecuritypolicy.yaml
394 +++ b/stable/kube-state-metrics/templates/podsecuritypolicy.yaml
395 @@ -4,12 +4,12 @@ kind: PodSecurityPolicy
396  metadata:
397    name: {{ template "kube-state-metrics.fullname" . }}
398    labels:
399 -    app: {{ template "kube-state-metrics.name" . }}
400 -    chart: {{ .Chart.Name }}-{{ .Chart.Version }}
401 -    heritage: {{ .Release.Service }}
402 -    release: {{ .Release.Name }}
403 -  annotations:
404 +    app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
405 +    helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
406 +    app.kubernetes.io/managed-by: {{ .Release.Service }}
407 +    app.kubernetes.io/instance: {{ .Release.Name }}
408  {{- if .Values.podSecurityPolicy.annotations }}
409 +  annotations:
410  {{ toYaml .Values.podSecurityPolicy.annotations | indent 4 }}
411  {{- end }}
412  spec:
413 diff --git a/stable/kube-state-metrics/templates/psp-clusterrole.yaml b/stable/kube-state-metrics/templates/psp-clusterrole.yaml
414 index c43f90d..dcd65e1 100644
415 --- a/stable/kube-state-metrics/templates/psp-clusterrole.yaml
416 +++ b/stable/kube-state-metrics/templates/psp-clusterrole.yaml
417 @@ -3,10 +3,10 @@ apiVersion: rbac.authorization.k8s.io/v1
418  kind: ClusterRole
419  metadata:
420    labels:
421 -    app: {{ template "kube-state-metrics.name" . }}
422 -    chart: {{ .Chart.Name }}-{{ .Chart.Version }}
423 -    heritage: {{ .Release.Service }}
424 -    release: {{ .Release.Name }}
425 +    app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
426 +    helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
427 +    app.kubernetes.io/managed-by: {{ .Release.Service }}
428 +    app.kubernetes.io/instance: {{ .Release.Name }}
429    name: psp-{{ template "kube-state-metrics.fullname" . }}
430  rules:
431  - apiGroups: ['extensions']
432 diff --git a/stable/kube-state-metrics/templates/psp-clusterrolebinding.yaml b/stable/kube-state-metrics/templates/psp-clusterrolebinding.yaml
433 index bfca12c..7418618 100644
434 --- a/stable/kube-state-metrics/templates/psp-clusterrolebinding.yaml
435 +++ b/stable/kube-state-metrics/templates/psp-clusterrolebinding.yaml
436 @@ -3,10 +3,10 @@ apiVersion: rbac.authorization.k8s.io/v1
437  kind: ClusterRoleBinding
438  metadata:
439    labels:
440 -    app: {{ template "kube-state-metrics.name" . }}
441 -    chart: {{ .Chart.Name }}-{{ .Chart.Version }}
442 -    heritage: {{ .Release.Service }}
443 -    release: {{ .Release.Name }}
444 +    app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
445 +    helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
446 +    app.kubernetes.io/managed-by: {{ .Release.Service }}
447 +    app.kubernetes.io/instance: {{ .Release.Name }}
448    name: psp-{{ template "kube-state-metrics.fullname" . }}
449  roleRef:
450    apiGroup: rbac.authorization.k8s.io
451 diff --git a/stable/kube-state-metrics/templates/service.yaml b/stable/kube-state-metrics/templates/service.yaml
452 index b6daacd..a880bf9 100644
453 --- a/stable/kube-state-metrics/templates/service.yaml
454 +++ b/stable/kube-state-metrics/templates/service.yaml
455 @@ -3,14 +3,20 @@ kind: Service
456  metadata:
457    name: {{ template "kube-state-metrics.fullname" . }}
458    labels:
459 -    app: {{ template "kube-state-metrics.name" . }}
460 -    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
461 -    release: "{{ .Release.Name }}"
462 -    heritage: "{{ .Release.Service }}"
463 -  {{- if .Values.prometheusScrape }}
464 +    app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
465 +    helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
466 +    app.kubernetes.io/instance: "{{ .Release.Name }}"
467 +    app.kubernetes.io/managed-by: "{{ .Release.Service }}"
468 +{{- if .Values.customLabels }}
469 +{{ toYaml .Values.customLabels | indent 4 }}
470 +{{- end }}
471    annotations:
472 +    {{- if .Values.prometheusScrape }}
473      prometheus.io/scrape: '{{ .Values.prometheusScrape }}'
474 -  {{- end }}
475 +    {{- end }}
476 +    {{- if .Values.service.annotations }}
477 +    {{- toYaml .Values.service.annotations | nindent 4 }}
478 +    {{- end }}
479  spec:
480    type: "{{ .Values.service.type }}"
481    ports:
482 @@ -25,5 +31,5 @@ spec:
483    loadBalancerIP: "{{ .Values.service.loadBalancerIP }}"
484  {{- end }}
485    selector:
486 -    app: {{ template "kube-state-metrics.name" . }}
487 -    release: {{ .Release.Name }}
488 +    app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
489 +    app.kubernetes.io/instance: {{ .Release.Name }}
490 diff --git a/stable/kube-state-metrics/templates/serviceaccount.yaml b/stable/kube-state-metrics/templates/serviceaccount.yaml
491 index edac3b9..e2bf7c0 100644
492 --- a/stable/kube-state-metrics/templates/serviceaccount.yaml
493 +++ b/stable/kube-state-metrics/templates/serviceaccount.yaml
494 @@ -1,15 +1,13 @@
495 -{{- if .Values.rbac.create -}}
496  {{- if .Values.serviceAccount.create -}}
497  apiVersion: v1
498  kind: ServiceAccount
499  metadata:
500    labels:
501 -    app: {{ template "kube-state-metrics.name" . }}
502 -    chart: {{ .Chart.Name }}-{{ .Chart.Version }}
503 -    heritage: {{ .Release.Service }}
504 -    release: {{ .Release.Name }}
505 +    app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
506 +    helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
507 +    app.kubernetes.io/managed-by: {{ .Release.Service }}
508 +    app.kubernetes.io/instance: {{ .Release.Name }}
509    name: {{ template "kube-state-metrics.fullname" . }}
510  imagePullSecrets:
511  {{ toYaml .Values.serviceAccount.imagePullSecrets | indent 2 }}
512  {{- end -}}
513 -{{- end -}}
514 diff --git a/stable/kube-state-metrics/templates/servicemonitor.yaml b/stable/kube-state-metrics/templates/servicemonitor.yaml
515 new file mode 100644
516 index 0000000..6405bd4
517 --- /dev/null
518 +++ b/stable/kube-state-metrics/templates/servicemonitor.yaml
519 @@ -0,0 +1,24 @@
520 +{{- if .Values.prometheus.monitor.enabled }}
521 +apiVersion: monitoring.coreos.com/v1
522 +kind: ServiceMonitor
523 +metadata:
524 +  name: {{ template "kube-state-metrics.fullname" . }}
525 +  labels:
526 +    app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
527 +    helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
528 +    app.kubernetes.io/instance: "{{ .Release.Name }}"
529 +    app.kubernetes.io/managed-by: "{{ .Release.Service }}"
530 +    {{- if .Values.prometheus.monitor.additionalLabels }}
531 +{{ toYaml .Values.prometheus.monitor.additionalLabels | indent 4 }}
532 +    {{- end }}
533 +spec:
534 +  selector:
535 +    matchLabels:
536 +      app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
537 +      app.kubernetes.io/instance: {{ .Release.Name }}
538 +  endpoints:
539 +    - port: http
540 +      {{- if .Values.prometheus.monitor.honorLabels }}
541 +      honorLabels: true
542 +      {{- end }}
543 +{{- end }}
544 diff --git a/stable/kube-state-metrics/values.yaml b/stable/kube-state-metrics/values.yaml
545 index 86aab9b..2bf5b30 100644
546 --- a/stable/kube-state-metrics/values.yaml
547 +++ b/stable/kube-state-metrics/values.yaml
548 @@ -1,8 +1,8 @@
549  # Default values for kube-state-metrics.
550  prometheusScrape: true
551  image:
552 -  repository: k8s.gcr.io/kube-state-metrics
553 -  tag: v1.5.0
554 +  repository: quay.io/coreos/kube-state-metrics
555 +  tag: v1.8.0
556    pullPolicy: IfNotPresent
557  
558  replicas: 1
559 @@ -13,6 +13,11 @@ service:
560    type: ClusterIP
561    nodePort: 0
562    loadBalancerIP: ""
563 +  annotations: {}
564 +
565 +customLabels: {}
566 +
567 +hostNetwork: false
568  
569  rbac:
570    # If true, create & use RBAC resources
571 @@ -28,6 +33,13 @@ serviceAccount:
572    # ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
573    imagePullSecrets: []
574  
575 +prometheus:
576 +  monitor:
577 +    enabled: false
578 +    additionalLabels: {}
579 +    namespace: ""
580 +    honorLabels: false
581 +
582  ## Specify if a Pod Security Policy for kube-state-metrics must be created
583  ## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/
584  ##
585 @@ -53,6 +65,10 @@ securityContext:
586  ## Ref: https://kubernetes.io/docs/user-guide/node-selection/
587  nodeSelector: {}
588  
589 +## Affinity settings for pod assignment
590 +## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
591 +affinity: {}
592 +
593  ## Tolerations for pod assignment
594  ## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
595  tolerations: []
596 @@ -66,12 +82,14 @@ podAnnotations: {}
597  # Available collectors for kube-state-metrics. By default all available
598  # collectors are enabled.
599  collectors:
600 +  certificatesigningrequests: true
601    configmaps: true
602    cronjobs: true
603    daemonsets: true
604    deployments: true
605    endpoints: true
606    horizontalpodautoscalers: true
607 +  ingresses: true
608    jobs: true
609    limitranges: true
610    namespaces: true
611 @@ -86,6 +104,8 @@ collectors:
612    secrets: true
613    services: true
614    statefulsets: true
615 +  storageclasses: true
616 +  verticalpodautoscalers: false
617  
618  # Namespace to be enabled for collecting resources. By default all namespaces are collected.
619  # namespace: ""
620 -- 
621 1.8.3.1
622