Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

[stable/prometheus-operator] Fix conditions in the default rule templates#19335

Merged
k8s-ci-robot merged 4 commits intohelm:masterfrom
vasrem:bugfix/groups_in_sync_prometheus_rules
Dec 7, 2019
Merged

[stable/prometheus-operator] Fix conditions in the default rule templates#19335
k8s-ci-robot merged 4 commits intohelm:masterfrom
vasrem:bugfix/groups_in_sync_prometheus_rules

Conversation

@vasrem
Copy link
Copy Markdown
Contributor

@vasrem vasrem commented Dec 3, 2019

Is this a new chart

No

What this PR does / why we need it:

Fixes 2 known issues. Currently, it's impossible to opt out of some default rules because the conditions in the templates are generated incorrectly. The flags which were affected were:

  • prometheus.defaultRules.rules.kubernetesSystem
  • prometheus.defaultRules.rules.prometheus

This PR addresses the handling of the edge cases, since the groups were renamed in 1.14. It addresses them by adding more entries to handle both cases.

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 decided not to introduce different chart values and keep the interface the same since the handling is getting even more complex. Please provide feedback if it's needed to proceed this way.

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • DCO signed
  • Chart Version bumped
  • Title of the PR starts with chart name (e.g. [stable/mychartname])

@helm-bot helm-bot added the Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). label Dec 3, 2019
@helm-bot helm-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 3, 2019
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 3, 2019
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @vasrem. Thanks for your PR.

I'm waiting for a helm member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

- alert: PrometheusRemoteWriteDesiredShards
annotations:
description: Prometheus {{`{{$labels.namespace}}`}}/{{`{{$labels.pod}}`}} remote write desired shards calculation wants to run {{`{{ printf $value }}`}} shards, which is more than the max of {{print `{{ printf ` "`" `prometheus_remote_storage_shards_max{instance="%s",job="{{ $prometheusJob }}",namespace="{{ $namespace }}"}` "`" ` $labels.instance | query | first | value }}`}}.
description: Prometheus {{`{{$labels.namespace}}`}}/{{`{{$labels.pod}}`}} remote write desired shards calculation wants to run {{`{{ $value }}`}} shards, which is more than the max of {{`{{ printf `prometheus_remote_storage_shards_max{instance="%s",job="{{ $prometheusJob }}",namespace="{{ $namespace }}"}` $labels.instance | query | first | value }}`}}.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is unrelated to this PR and it breaks yaml linting in CI. The problem is already present in master. I am going to revert this small change here.

Signed-off-by: Vasilis Remmas <vasremm@gmail.com>
Signed-off-by: Vasilis Remmas <vasremm@gmail.com>
Signed-off-by: Vasilis Remmas <vasremm@gmail.com>
Signed-off-by: Vasilis Remmas <vasremm@gmail.com>
@vasrem vasrem force-pushed the bugfix/groups_in_sync_prometheus_rules branch from 7abc530 to 8504f1c Compare December 5, 2019 10:15
@vasrem
Copy link
Copy Markdown
Contributor Author

vasrem commented Dec 6, 2019

/assign @gianrubio

@zanhsieh
Copy link
Copy Markdown
Collaborator

zanhsieh commented Dec 7, 2019

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 7, 2019
@vsliouniaev
Copy link
Copy Markdown
Collaborator

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 7, 2019
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vasrem, vsliouniaev

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 7, 2019
@k8s-ci-robot k8s-ci-robot merged commit c8410aa into helm:master Dec 7, 2019
WyriHaximus pushed a commit to WyriHaximus-labs/charts that referenced this pull request Dec 14, 2019
…ates (helm#19335)

* Add more groups to address corner cases

Signed-off-by: Vasilis Remmas <vasremm@gmail.com>

* Run sync_prometheus_rules.py

Signed-off-by: Vasilis Remmas <vasremm@gmail.com>

* Bump chart version

Signed-off-by: Vasilis Remmas <vasremm@gmail.com>

* Revert unrelated change

Signed-off-by: Vasilis Remmas <vasremm@gmail.com>
dargolith pushed a commit to dargolith/charts that referenced this pull request Jan 10, 2020
…ates (helm#19335)

* Add more groups to address corner cases

Signed-off-by: Vasilis Remmas <vasremm@gmail.com>

* Run sync_prometheus_rules.py

Signed-off-by: Vasilis Remmas <vasremm@gmail.com>

* Bump chart version

Signed-off-by: Vasilis Remmas <vasremm@gmail.com>

* Revert unrelated change

Signed-off-by: Vasilis Remmas <vasremm@gmail.com>
arturrez pushed a commit to arturrez/stable-charts that referenced this pull request Jan 28, 2020
…ates (helm#19335)

* Add more groups to address corner cases

Signed-off-by: Vasilis Remmas <vasremm@gmail.com>

* Run sync_prometheus_rules.py

Signed-off-by: Vasilis Remmas <vasremm@gmail.com>

* Bump chart version

Signed-off-by: Vasilis Remmas <vasremm@gmail.com>

* Revert unrelated change

Signed-off-by: Vasilis Remmas <vasremm@gmail.com>
Signed-off-by: Artur <artur@upbound.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). lgtm Indicates that a PR is ready to be merged. ok-to-test size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[stable/prometheus-operator] not possible to opt out of prometheus rules [stable/prometheus-operator] defaultRules.rules.kubernetesSystem in k8s 1.14

6 participants