helm-charts icon indicating copy to clipboard operation
helm-charts copied to clipboard

[kube-prometheus-stack] Invalid: spec.groups[0].rules: Invalid value: "null": spec.groups[0].rules in body must be of type array: "null"

Open ochertkov-napier opened this issue 1 year ago • 2 comments

Describe the bug a clear and concise description of what the bug is.

When installing kube-prometheus-stack with helm we see the issue with validation of helm chart for kube-apiserver-slos PrometheusRule when the defaultRules.disabled.KubeAPIErrorBudgetBurn is set to true in values.yaml

command we run to install kube-prometheus-stack helm chart: helm install kube-prometheus-stack ./ -f ./values.yaml -n kube-prometheus-stack

error we get: PrometheusRule.monitoring.coreos.com "kube-prometheus-stack-k-kube-apiserver-slos" is invalid: spec.groups[0].rules: Invalid value: "null": spec.groups[0].rules in body must be of type array: "null"

What's your helm version?

version.BuildInfo{Version:"v3.8.2", GitCommit:"6e3701edea09e5d55a8ca2aae03a68917630e91b", GitTreeState:"clean", GoVersion:"go1.17.5"}

What's your kubectl version?

Client Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.3", GitCommit:"25b4e43193bcda6c7328a6d147b1fb73a33f1598", GitTreeState:"clean", BuildDate:"2023-06-14T09:53:42Z", GoVersion:"go1.20.5", Compiler:"gc", Platform:"darwin/amd64"}

Which chart?

kube-prometheus-stack

What's the chart version?

48.1.2

What happened?

When installing kube-prometheus-stack with helm we see the issue with creation of kube-apiserver-slos PrometheusRule when the defaultRules.disabled.KubeAPIErrorBudgetBurn is set to true in values.yaml

error we get: PrometheusRule.monitoring.coreos.com "kube-prometheus-stack-k-kube-apiserver-slos" is invalid: spec.groups[0].rules: Invalid value: "null": spec.groups[0].rules in body must be of type array: "null"

What you expected to happen?

Do not see an error with helm chart validation when the defaultRules.disabled.KubeAPIErrorBudgetBurn is set to true in values.yaml

How to reproduce it?

helm install kube-prometheus-stack ./ -f ./values.yaml -n kube-prometheus-stack

Enter the changed values of values.yaml?

defaultRules:
  disabled:
    KubeAPIErrorBudgetBurn: true

Enter the command that you execute and failing/misfunctioning.

helm install kube-prometheus-stack ./ -f ./values.yaml -n kube-prometheus-stack

Anything else we need to know?

No response

ochertkov-napier avatar Dec 11 '23 14:12 ochertkov-napier

I'm having the same problem with v56.6.2 with the following in values.yaml

defaultRules:
  disabled:
    KubeControllerManagerDown: true
    KubeSchedulerDown: true

sfrolich avatar Feb 06 '24 17:02 sfrolich

I was able to work around this by using the higher level disable options:

defaultRules: disabled: etcdMembersDown: true KubeSchedulerDown: true KubeProxyDown: true KubeControllerManagerDown: true

For the last one, here is what I used: https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/kubernetes-system-controller-manager.yaml#L7

vs. what people here are reporting and I tried first: https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/kubernetes-system-controller-manager.yaml#L28

aspyker avatar May 22 '24 03:05 aspyker