You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug a clear and concise description of what the bug is.
If we add custom label to defaulRules.additionalRuleGroupLabels.:
and then we configure prometheus.prometheusSpec.ruleSelector to match this label,
Prometheus config-reloader will not be able to pick up the rule based on the label, because it tries to fetch by prometheusRule.metadata.label instead of prometheusRule.spec.groups.rule.labels
What's your helm version?
3.16
What's your kubectl version?
1.31.0
Which chart?
kube-prometheus-stack
What's the chart version?
66.2.1
What happened?
In my values file i've used:
prometheus:
prometheusSpec:
ruleSelector:
matchExpressions:
- key: role
operator: In
values:
- local-rules
However configmap prometheus-rulefiles-0 had no data in it.
What you expected to happen?
It should only contain the k8sContainerCpuUsageSecondsTotal rules.
How to reproduce it?
Try to use my values and apply, prometheus-rulefiles-0 configmap will be empty, after that manualy add label to k8s resource PrometheusRule.metadata.labels and you will see that it gets loaded correctly
Enter the changed values of values.yaml?
No response
Enter the command that you execute and failing/misfunctioning.
--
Anything else we need to know?
On the other hand, when i looked into k8s.rule template in helm, it seems:
labels:
{{- with .Values.defaultRules.additionalRuleLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.defaultRules.additionalRuleGroupLabels.k8sContainerCpuUsageSecondsTotal }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
addiotnalRuleLabels maybe should be moved up to metadata.labels instead?
The text was updated successfully, but these errors were encountered:
Describe the bug a clear and concise description of what the bug is.
If we add custom label to defaulRules.additionalRuleGroupLabels.:
and then we configure prometheus.prometheusSpec.ruleSelector to match this label,
Prometheus config-reloader will not be able to pick up the rule based on the label, because it tries to fetch by prometheusRule.metadata.label instead of prometheusRule.spec.groups.rule.labels
What's your helm version?
3.16
What's your kubectl version?
1.31.0
Which chart?
kube-prometheus-stack
What's the chart version?
66.2.1
What happened?
In my values file i've used:
and
However configmap prometheus-rulefiles-0 had no data in it.
What you expected to happen?
It should only contain the k8sContainerCpuUsageSecondsTotal rules.
How to reproduce it?
Try to use my values and apply, prometheus-rulefiles-0 configmap will be empty, after that manualy add label to k8s resource PrometheusRule.metadata.labels and you will see that it gets loaded correctly
Enter the changed values of values.yaml?
No response
Enter the command that you execute and failing/misfunctioning.
--
Anything else we need to know?
On the other hand, when i looked into k8s.rule template in helm, it seems:
addiotnalRuleLabels maybe should be moved up to metadata.labels instead?
The text was updated successfully, but these errors were encountered: