Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kube-prometheus-stack] let additionalRuleGroupLabels override additionalRuleLabels #4395

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

michaelruigrok
Copy link

What this PR does / why we need it

This PR ensures that rule annotations and labels that are specific to a rule group -- i.e., the ones set in .Values.defaultRules.additionalRuleGroup(Labels|Annotations) -- will override values set in the global defaults (e.g. .defaultRules.additionalRuleLabels). Specifically, this change allows the following configuration, which applies a global label except to rules which would break if such labels were applied.

defaultRules:
  additionalRules:
    cluster: cluster-nam

  additionalRuleGroupLabels:
    kubeApiserverAvailability:
      cluster: null

This provides a workaround to #3396, where a rule in kube-apiserver-availability.rules will fail when labels are applied to it.

Which issue this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

Special notes for your reviewer

I am unsure if releases are performed for every PR, or PRs are held for larger releases. As such I have not bumped the chart version for this PR. Please let me know if I should do so, thanks.

Checklist

  • DCO signed
  • Chart Version bumped
  • Title of the PR starts with chart name (e.g. [prometheus-couchdb-exporter])

Signed-off-by: Michael Ruigrok <michael.ruigrok@workingmouse.com.au>
(.Values.defaultRules.additionalRuleGroupLabels.k8sContainerMemoryCache | default (dict))
}}

{{- if $v }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats not a great condition. It prevent label values like 0 or false.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, thank you I'll fix this up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants