prometheus-community/helm-charts

[kube-prometheus-stack] Default thanos-ruler name too long

vitaliyf opened this issue · 3 comments

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

Upgrading to kube-prometheus-stack version 58.x with thanosRuler.enabled=true broke thanos-ruler, with:

create Pod thanos-ruler-prometheus-kube-prometheus-thanos-ruler-0 in StatefulSet thanos-ruler-prometheus-kube-prometheus-thanos-ruler failed error: Pod "thanos-ruler-prometheus-kube-prometheus-thanos-ruler-0" is invalid: [spec.volumes[3].name: Invalid value: "thanos-ruler-prometheus-kube-prometheus-thanos-ruler-rulefiles-0": must be no more than 63 characters, spec.containers[0].volumeMounts[4].name: Not found: "thanos-ruler-prometheus-kube-prometheus-thanos-ruler-rulefiles-0", spec.containers[1].volumeMounts[0].name: Not found: "thanos-ruler-prometheus-kube-prometheus-thanos-ruler-rulefiles-0"]

this sounds similar to #2408 and #3020 and I suspect regressed because of #4439

What's your helm version?

version.BuildInfo{Version:"v3.14.4", GitCommit:"81c902a123462fd4052bc5e9aa9c513c4c8fc142", GitTreeState:"clean", GoVersion:"go1.21.9"}

What's your kubectl version?

v1.28.9

Which chart?

kube-prometheus-stack

What's the chart version?

58.3.1

What happened?

The diff between helm template of 58.0.0 and 58.0.1 changes ThanosRuler's name, making it slightly too long:

<   name: kube-prometheus-stack-thanos-ruler
>   name: prometheus-kube-prometheus-thanos-ruler

What you expected to happen?

No response

How to reproduce it?

No response

Enter the changed values of values.yaml?

thanosRuler:
  enabled: true
cleanPrometheusOperatorObjectNames: false

Enter the command that you execute and failing/misfunctioning.

helm upgrade --install prometheus prometheus-community/kube-prometheus-stack --values ourfile.yaml --version 58.3.1

Anything else we need to know?

/cc @than-pet since you worked on #4439

@vitaliyf i could reproduce the issue. You are correct.
The underlying issue is that the operator creates a configmap with the following pattern: thanos-ruler-${.Values.ube-prometheus-stack.thanosRuler.crname}-rulefiles-0, which must be no more than 63 characters.

The issue introduced by this

I will commit a fix to restrict the length of the string

Confirmed fixed. Thank you!