prometheus-community / helm-charts

Prometheus community Helm charts
Apache License 2.0
5.06k stars 5.01k forks source link

[kube-state-metrics] Collectors has optional resource verticalpodautoscalers as a default #1131

Closed stevehipwell closed 3 years ago

stevehipwell commented 3 years ago

Describe the bug The kube-state-metrics helm chart includes a collector for verticalpodautoscalers which is an optional resource and not installed in a cluster by default. This causes a large number of errors to be logged. This is compounded by the way the collectors are configured in an array meaning if you wish to turn this off you need to maintain the list of collectors and not get updates from the chart.

Version of Helm and Kubernetes:

Helm Version: n/a

Kubernetes Version: v1.18, v1.19, v1.20

Which chart: kube-state-metrics

Which version of the chart: v3.3.1

What happened: A large number of errors.

E0702 09:40:01.750260 1 reflector.go:138] pkg/mod/k8s.io/client-go@v0.20.5/tools/cache/reflector.go:167: Failed to watch v1beta2.VerticalPodAutoscaler: failed to list v1beta2.VerticalPodAutoscaler: the server could not find the requested resource (get verticalpodautoscalers.autoscaling.k8s.io)

What you expected to happen:

How to reproduce it (as minimally and precisely as possible): Install chart into bare cluster and watch the logs.

Changed values of values.yaml (only put values which differ from the defaults): n/a

The helm command that you execute and failing/misfunctioning:

n/a

Helm values set after installation/upgrade:

n/a

Anything else we need to know:

I'd suggest removing verticalpodautoscalers from the collectors value and adding an additionalCollectors value that is concated with collectors in the chart to enable augmenting the default without having to manage them (verticalpodautoscalers could be added to this but I'd suggest not as you will get errors on a default install on a default cluster). I'd happily open a PR for this.

jb-2020 commented 3 years ago

Is there a simple way to remove this element from the collectors list without overriding the entire list?

stevehipwell commented 3 years ago

@jb-2020 no easy way to modify a single element in an array. My issue has the potential options in it.

stevehipwell commented 3 years ago

Thank you @mrueg.