-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Metrics: Fix nginx_ingress_controller_config_last_reload_successful.
#13830
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
Conversation
…_successful metric was reporting an incorrect value Signed-off-by: Roman Orudzhov <[email protected]>
✅ Deploy Preview for kubernetes-ingress-nginx canceled.
|
|
|
|
Welcome @raorudzhov! |
|
Hi @raorudzhov. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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-sigs/prow repository. |
nginx_ingress_controller_config_last_reload_successful.
Gacko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/triage accepted
/kind cleanup
/priority backlog
/hold
Do you think it's possible to test this in either unit tests or E2E tests (or both)?
|
/cherry-pick release-1.13 |
|
/cherry-pick release-1.12 |
|
@Gacko: once the present PR merges, I will cherry-pick it on top of In response to this:
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-sigs/prow repository. |
|
@Gacko: once the present PR merges, I will cherry-pick it on top of In response to this:
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-sigs/prow repository. |
|
Most likely, the current e2e tests don’t cover this, but if we add handling for this scenario, the functionality will most likely be covered. |
|
I'm not that deep in our E2E tests, Go code wise, but I can imagine them to be able to do something like "use invalid config, check the metric is 0, fix config, check the metric is 1". That would be enough! Also I'd like to have the expected behavior written down somewhere, so in tests, also to be able to prevent any regression. |
|
Got it! Just to clarify — do you want me to expand this with actual E2E test cases? So that you can accept PR |
|
Exactly, that would be wonderful! I'm currently about to start a new release cycle, so if you hurry this would still make it into a v1.13.2 / v1.12.6. 🙂 |
|
So, I took a deeper look and I think it's hard to impossible to test this, because this needs an invalid Ingress to recover from and currently configuring Ingress resources in E2E tests always waits for the controller and NGINX to have been reloaded. I'm gonna test this manually for now. |
Gacko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/triage accepted
/kind bug
/priority backlog
/hold
/ok-to-test
Ok, I tested the current main with and without your change and a) you're right, it's not working without and b) your change fixes it. As stated before I currently have hard times believing this can be covered by tests as these wait for the reload to succeed after a configuration change and I do not have the resources to extend our testing framework for this use-case at the moment.
Let me just bump some images I promoted today, then I will merge your PR and kick of the controller build for the next patch release.
|
Thank you for your help |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Gacko, raorudzhov The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@Gacko: new pull request created: #13859 In response to this:
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-sigs/prow repository. |
|
@Gacko: new pull request created: #13860 In response to this:
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-sigs/prow repository. |
What this PR does / why we need it:
This patch fixes an issue in the NGINX Ingress Controller where invalid Ingress resources caused metric
nginx_ingress_controller_config_last_reload_successfulto be set value to0and never restored after the resource was deleted.With this change, metrics are now correctly updated even if an Ingress is removed, or its configuration is invalid.
This ensures that monitoring data remains consistent and accurate.
🪲 P.S. this PR also resolved Issue#13818
Previously, when an Ingress contained misconfigurations (e.g. invalid annotations or unsupported snippet directives), the following problems occurred:
nginx_ingress_controller_config_last_reload_successfulwere set to0.0instead of being restored to1.syncIngresslogic were skipped due to an earlyEqualcheck, preventing proper metric updates.As a result:
This patch resolves those issues by ensuring metrics are always properly updated, regardless of Ingress validity.
Types of changes
Which issue/s this PR fixes
This PR fixed Issue#13818
How Has This Been Tested?
0;1.Checklist: