Skip to content

Check controller_runtime_webhook_requests_total that always exists in both pods #456

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

Merged
merged 1 commit into from
Mar 21, 2025

Conversation

ardaguclu
Copy link
Contributor

@ardaguclu ardaguclu commented Mar 20, 2025

What type of PR is this?

/kind flake
/kind cleanup

What this PR does / why we need it

LWS runs 2 pods and one of them is elected as leader. So that reconciliation logic will only be running in the leader pod and the other will only accept webhook requests.

controller_runtime_reconcile_total is the measurement of how many times reconciliation function is executed. As a result, if there isn't any leader changes between pods, leader pod's reconciliation is supposed to be always greater than 0 and the other one should always be equal to 0.

That means this test should be flaky and it should fail when it gets the metrics from non-leader pod (although I couldn't find any such failures, maybe because at some point leader pod has changed?).

This PR switches to controller_runtime_webhook_requests_total metric to check for the presence. Service resource should distribute the webhook traffic between 2 pods in round robin and it is guaranteed that controller_runtime_webhook_requests_total should exist in both of the pods unlike to controller_runtime_reconcile_total.

Does this PR introduce a user-facing change?

None

@k8s-ci-robot k8s-ci-robot added kind/flake Categorizes issue or PR as related to a flaky test. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Mar 20, 2025
@k8s-ci-robot k8s-ci-robot requested a review from ahg-g March 20, 2025 09:37
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 20, 2025
@k8s-ci-robot k8s-ci-robot requested a review from Edwinhr716 March 20, 2025 09:37
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 20, 2025
Copy link

netlify bot commented Mar 20, 2025

Deploy Preview for kubernetes-sigs-lws canceled.

Name Link
🔨 Latest commit 51ee64c
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-lws/deploys/67dbe1bc4869ae0008cff84b

@Edwinhr716
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 21, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ardaguclu, Edwinhr716

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 /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 Mar 21, 2025
@k8s-ci-robot k8s-ci-robot merged commit 621dde7 into kubernetes-sigs:main Mar 21, 2025
12 checks passed
@ardaguclu ardaguclu deleted the curl-metrics branch March 21, 2025 04:39
@kerthcet kerthcet mentioned this pull request Mar 26, 2025
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/flake Categorizes issue or PR as related to a flaky test. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants