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] Resolve Issue 3340 #3351

Merged
merged 22 commits into from
May 17, 2023

Conversation

scott-grimes
Copy link
Contributor

@scott-grimes scott-grimes commented May 8, 2023

What this PR does / why we need it

Ensures .defaultRules.additionalRuleLabels are correctly templated for all PrometheusRules

Which issue this PR fixes

Special notes for your reviewer

There are 3 cases encountered:

  1. a labels: block already exists for a PrometheusRule, but has no entries. In this case the template block is appended immediately after the labels: line

  2. a labels: block already exists for a PrometheusRule, and has one or more entries. In this case the template block is appended at the end of the existing entries

  3. no labels: block exists. In this case labels: is appended to the end of the rule and the template block is added immediately after the labels: line

Checklist

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

scott-grimes and others added 11 commits May 8, 2023 10:43
Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>
Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>
Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>
…us-community#3336)

Signed-off-by: rob <rob@unx.pl>
Co-authored-by: MH <zanhsieh@gmail.com>
Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>
* Bump Prometheus to v2.43.1

Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com>
Co-authored-by: MH <zanhsieh@gmail.com>
Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>
Signed-off-by: Tom Walker <walker.thomas.p@gmail.com>
Signed-off-by: MH <zanhsieh@gmail.com>
Co-authored-by: MH <zanhsieh@gmail.com>
Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>
…rometheus-community#3343)

Signed-off-by: Tom Walker <walker.thomas.p@gmail.com>
Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>
…eus-community#3115)

* [prometheus-stackdriver-exporter] Add prometheusRule support

Signed-off-by: Baptiste Roux <arte.but.posix@gmail.com>

* [prometheus-stackdriver-exporter] Bump version to 4.3.0

Signed-off-by: Baptiste Roux <arte.but.posix@gmail.com>

---------

Signed-off-by: Baptiste Roux <arte.but.posix@gmail.com>
Co-authored-by: MH <zanhsieh@gmail.com>
Co-authored-by: Rico Pahlisch <pahli88@googlemail.com>
Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>
…eadiness prob… (prometheus-community#3337)

* dongjiang, add prometheus config reloader liveness and readiness probe setting

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* update appVersion to v0.65.1

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* Update the Chart version to 45.26.0

Signed-off-by: dongjiang <dongjiang1989@126.com>
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* dongjiang, fix trailing spaces

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

---------

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Signed-off-by: dongjiang <dongjiang1989@126.com>
* Add support for env vars for configmap-reload
  to better support basic authentication at Prometheus

* Bump configmap-reload release to 0.65.1

* Update values schema with the latest values

Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com>
Co-authored-by: MH <zanhsieh@gmail.com>
Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>
Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com>
Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>
scott-grimes and others added 3 commits May 8, 2023 10:45
Signed-off-by: Scott Grimes <scott-grimes@users.noreply.github.com>
Signed-off-by: Scott Grimes <scott-grimes@users.noreply.github.com>
@zanhsieh zanhsieh changed the title kube-prometheus-stack - Resolve Issue 3340 [kube-prometheus-stack] Resolve Issue 3340 May 9, 2023
@scott-grimes
Copy link
Contributor Author

Fyi @zanhsieh looks like the failed lint actually succeeded but then hit an auth error calling back to github

Success: no issues found in 1 source file
------
2023-05-09 02:46:16 [INFO]   ----------------------------------------------
2023-05-09 02:46:16 [INFO]   ----------------------------------------------
2023-05-09 02:46:16 [INFO]   The script has completed
2023-05-09 02:46:16 [INFO]   ----------------------------------------------
2023-05-09 02:46:16 [INFO]   ----------------------------------------------
2023-05-09 02:46:16 [INFO]   ERROR! Failed to call GitHub Status API!
2023-05-09 02:46:16 [INFO]   ERROR:[curl: (22) The requested URL returned error: 403]
2023-05-09 02:46:16 [ERROR]   ERRORS FOUND in PYTHON_PYLINT:[1]
2023-05-09 02:46:16 [INFO]   ERROR! Failed to call GitHub Status API!
2023-05-09 02:46:17 [INFO]   ERROR:[curl: (22) The requested URL returned error: 403]
2023-05-09 02:46:17 [INFO]   ERROR! Failed to call GitHub Status API!
2023-05-09 02:46:17 [INFO]   ERROR:[curl: (22) The requested URL returned error: 403]
2023-05-09 02:46:17 [INFO]   ERROR! Failed to call GitHub Status API!
2023-05-09 02:46:17 [INFO]   ERROR:[curl: (22) The requested URL returned error: 403]
2023-05-09 02:46:17 [FATAL]   Exiting with errors found!

Signed-off-by: Scott Grimes <scott-grimes@users.noreply.github.com>
Signed-off-by: Scott Grimes <scott-grimes@users.noreply.github.com>
@gkarthiks
Copy link
Member

can you please address the lint issue?

@scott-grimes
Copy link
Contributor Author

@gkarthiks

Notice:  A new release of pip available: 22.3.1 -> 23.1.2
Notice:  To update, run: python -m pip install --upgrade pip
Installing missing stub packages:
/venvs/mypy/bin/python -m pip install types-PyYAML types-requests


Success: no issues found in 1 source file
------
2023-05-11 01:32:09 [INFO]   ----------------------------------------------
2023-05-11 01:32:09 [INFO]   ----------------------------------------------
2023-05-11 01:32:09 [INFO]   The script has completed
2023-05-11 01:32:09 [INFO]   ----------------------------------------------
2023-05-11 01:32:09 [INFO]   ----------------------------------------------
2023-05-11 01:32:09 [INFO]   ERROR! Failed to call GitHub Status API!
2023-05-11 01:32:09 [INFO]   ERROR:[curl: (22) The requested URL returned error: 403]
2023-05-11 01:32:09 [ERROR]   ERRORS FOUND in PYTHON_PYLINT:[1]
2023-05-11 01:32:09 [INFO]   ERROR! Failed to call GitHub Status API!
2023-05-11 01:32:09 [INFO]   ERROR:[curl: (22) The requested URL returned error: 403]
2023-05-11 01:32:10 [INFO]   ERROR! Failed to call GitHub Status API!
2023-05-11 01:32:10 [INFO]   ERROR:[curl: (22) The requested URL returned error: 403]
2023-05-11 01:32:10 [INFO]   ERROR! Failed to call GitHub Status API!
2023-05-11 01:32:10 [INFO]   ERROR:[curl: (22) The requested URL returned error: 403]
2023-05-11 01:32:10 [FATAL]   Exiting with errors found!

code actually lints fine, looks like theres a problem calling back to github from the workflow

Signed-off-by: Scott Grimes <scott-grimes@users.noreply.github.com>
@scott-grimes
Copy link
Contributor Author

Ah I see is failing on pylint-dev/pylint#1498, submitted lint fix

@scott-grimes
Copy link
Contributor Author

@gkarthiks @zanhsieh ready for review

Copy link
Member

@gkarthiks gkarthiks left a comment

Choose a reason for hiding this comment

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

lgtm

@zanhsieh zanhsieh merged commit fda9442 into prometheus-community:main May 17, 2023
@scott-grimes scott-grimes deleted the issue-3340 branch May 18, 2023 14:07
Matiasmct pushed a commit to giffgaff/prometheus-charts-backup that referenced this pull request May 31, 2023
* update add_custom_labels to apply labels to all PrometheusRules

Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>

* update rules templates compiled from sync_prometheus_rules.p6

Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>

* bump chart version

Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>

* fix node-exporter listen address with kubeRBACProxy enabled (prometheus-community#3336)

Signed-off-by: rob <rob@unx.pl>
Co-authored-by: MH <zanhsieh@gmail.com>
Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>

* [prometheus] Bump Prometheus release (prometheus-community#3335)

* Bump Prometheus to v2.43.1

Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com>
Co-authored-by: MH <zanhsieh@gmail.com>
Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>

* Fix RoleBinding subject namespace reference (prometheus-community#3342)

Signed-off-by: Tom Walker <walker.thomas.p@gmail.com>
Signed-off-by: MH <zanhsieh@gmail.com>
Co-authored-by: MH <zanhsieh@gmail.com>
Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>

* Update extraManifests example to be multiline string instead of YAML (prometheus-community#3343)

Signed-off-by: Tom Walker <walker.thomas.p@gmail.com>
Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>

* [prometheus-stackdriver-exporter] Add prometheusRule support (prometheus-community#3115)

* [prometheus-stackdriver-exporter] Add prometheusRule support

Signed-off-by: Baptiste Roux <arte.but.posix@gmail.com>

* [prometheus-stackdriver-exporter] Bump version to 4.3.0

Signed-off-by: Baptiste Roux <arte.but.posix@gmail.com>

---------

Signed-off-by: Baptiste Roux <arte.but.posix@gmail.com>
Co-authored-by: MH <zanhsieh@gmail.com>
Co-authored-by: Rico Pahlisch <pahli88@googlemail.com>
Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>

* [kube-prometheus-stack] add prometheus config reloader liveness and readiness prob… (prometheus-community#3337)

* dongjiang, add prometheus config reloader liveness and readiness probe setting

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* update appVersion to v0.65.1

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* Update the Chart version to 45.26.0

Signed-off-by: dongjiang <dongjiang1989@126.com>
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* dongjiang, fix trailing spaces

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

---------

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Signed-off-by: dongjiang <dongjiang1989@126.com>

* [prometheus] env vars for configmap-reload (prometheus-community#3344)

* Add support for env vars for configmap-reload
  to better support basic authentication at Prometheus

* Bump configmap-reload release to 0.65.1

* Update values schema with the latest values

Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com>
Co-authored-by: MH <zanhsieh@gmail.com>
Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>

* [prometheus] Fix volume name evaluation (prometheus-community#3348)

Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com>
Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>

* formatting

Signed-off-by: Scott Grimes <scott-grimes@users.noreply.github.com>

* Update Chart.yaml

Signed-off-by: Scott Grimes <scott-grimes@users.noreply.github.com>

* Update sync_prometheus_rules.py

Signed-off-by: Scott Grimes <scott-grimes@users.noreply.github.com>

---------

Signed-off-by: Scott Grimes <scott.grimes@waldzell.net>
Signed-off-by: rob <rob@unx.pl>
Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com>
Signed-off-by: Tom Walker <walker.thomas.p@gmail.com>
Signed-off-by: MH <zanhsieh@gmail.com>
Signed-off-by: Baptiste Roux <arte.but.posix@gmail.com>
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Signed-off-by: dongjiang <dongjiang1989@126.com>
Signed-off-by: Scott Grimes <scott-grimes@users.noreply.github.com>
Co-authored-by: Robert Jerzak <r0bj@users.noreply.github.com>
Co-authored-by: MH <zanhsieh@gmail.com>
Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com>
Co-authored-by: Tom Walker <walker.thomas.p@gmail.com>
Co-authored-by: Baptiste Roux <32563450+BapRx@users.noreply.github.com>
Co-authored-by: Rico Pahlisch <pahli88@googlemail.com>
Co-authored-by: dongjiang <dongjiang1989@126.com>
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.

[kube-prometheus-stack] defaultRules.additionalRuleLabels not applied to all the default PrometheusRules
8 participants