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

Fix nginx controller leader election failed on certain setup #10282

Closed

Conversation

vsamtuc
Copy link
Contributor

@vsamtuc vsamtuc commented Jul 10, 2023

Under the original code, leader election failed for ingress controllers as a result of mismatch between election-id in the controller config, and the resourceName in the relevant rule of role 'ingress-nginx'. This appeared in the contoller logs.

To fix the issue, a command-line option was added to container execution (--election-id=...).

Now, the electio-id agrees with the resourceName provided in the role-ingress-nginx.yml file. A comment in that file was changed to reflect the new logic.

What type of PR is this?

/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #10276

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Fix nginx controller leader election failed on certain setup

Under the original code, leader election failed for ingress controllers
as a result of mismatch between election-id in the controller config,
and the resourceName in the relevant rule of role 'ingress-nginx'.
This appeared in the contoller logs.

To fix the issue, a command-line option was added to container
execution (--election-id=...).

Now, the electio-id agrees with the resourceName provided in
the role-ingress-nginx.yml file. A comment in that file was
changed to reflect the new logic.
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 10, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: vsamtuc / name: Vasilis Samoladas (530e77f)
  • ✅ login: mzaian / name: Mohamed Omar Zaian (797fdbd)

@k8s-ci-robot k8s-ci-robot requested review from jayonlau and yankay July 10, 2023 16:33
@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jul 10, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @vsamtuc!

It looks like this is your first PR to kubernetes-sigs/kubespray 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kubespray has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@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 Jul 10, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @vsamtuc. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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.

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.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 10, 2023
@vsamtuc vsamtuc marked this pull request as draft July 10, 2023 16:34
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 10, 2023
@vsamtuc
Copy link
Contributor Author

vsamtuc commented Jul 10, 2023

Adding more detail to original comment:

Under the original code, leader election failed for ingress controllers as a result of mismatch between election-id in the controller config, and the resourceName in the relevant rule of role 'ingress-nginx'. This appeared in the contoller logs.

To fix the issue, a command-line option was added to container execution (--election-id=...).

Now, the election-id agrees with the resourceName provided in the role-ingress-nginx.yml file. A comment in that file was changed to reflect the new logic.

What type of PR is this?

/kind bug

What this PR does / why we need it:

Without it the ingress-nginx controller did not deploy correctly.

Which issue(s) this PR fixes:

Fixes # 10276

Special notes for your reviewer: Sorry for a confusing submission, this is my first PR in kubespray :-)

Does this PR introduce a user-facing change?: No

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 10, 2023
@vsamtuc vsamtuc marked this pull request as ready for review July 10, 2023 16:39
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 10, 2023
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jul 10, 2023
@yankay
Copy link
Member

yankay commented Jul 11, 2023

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 11, 2023
@yankay
Copy link
Member

yankay commented Jul 14, 2023

Thanks @vsamtuc for the PR

There are comments :-)
HI @mzaian , would you please help to review it :-)

@yankay
Copy link
Member

yankay commented Jul 14, 2023

The PR title and commit message can be changed to "Fix nginx controller leader election failed on certain setup"

@mzaian
Copy link
Contributor

mzaian commented Jul 14, 2023

Hello @vsamtuc

Please look at the below comment. I've reviewed and looks fine to me. Thank you!

The PR title and commit message can be changed to "Fix nginx controller leader election failed on certain setup"

@vsamtuc vsamtuc changed the title This commit fixes Issue # 10276. Fix nginx controller leader election failed on certain setup Jul 14, 2023
@mzaian
Copy link
Contributor

mzaian commented Aug 14, 2023

The PR title and commit message can be changed to "Fix nginx controller leader election failed on certain setup"

@vsamtuc Would you please check this and maybe rebase so we can merge this.

@tobiasehlert
Copy link

tobiasehlert commented Sep 19, 2023

Is there any update on this PR? :)

I updated my ClusterRole until merge.. adjusted it like this:
bitnami/charts#11192 (comment)

@michaelkebe
Copy link
Contributor

Please merge this. 🙏

I used the latest version v2.23.0 and stumpled upon this. 💥

Patched manually the fix from this PR and fixed it. ✅

Copy link
Contributor

@mzaian mzaian left a comment

Choose a reason for hiding this comment

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

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mzaian, vsamtuc

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 Oct 27, 2023
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 27, 2023
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@mzaian
Copy link
Contributor

mzaian commented Oct 27, 2023

Please merge this. 🙏

I used the latest version v2.23.0 and stumpled upon this. 💥

Patched manually the fix from this PR and fixed it. ✅

We will consider it in v2.23.1 see here: #10569

@VannTen
Copy link
Contributor

VannTen commented Jan 22, 2024

I think you should rebase, the CI failures might because master has changed stuff.

@VannTen
Copy link
Contributor

VannTen commented Feb 6, 2024

@vsamtuc ^

@VannTen
Copy link
Contributor

VannTen commented Feb 6, 2024

@mzaian do you have the write perms on this PR ? I think if we rebase it on master it should work

@mzaian
Copy link
Contributor

mzaian commented Feb 6, 2024

@mzaian do you have the write perms on this PR ? I think if we rebase it on master it should work

I cannot remember but I did a cherry-pick and referenced to this PR here https://github.com/kubernetes-sigs/kubespray/pull/10569/files We could do the same since that no response.

@floryut
Copy link
Member

floryut commented Feb 9, 2024

@mzaian do you have the write perms on this PR ? I think if we rebase it on master it should work

I cannot remember but I did a cherry-pick and referenced to this PR here https://github.com/kubernetes-sigs/kubespray/pull/10569/files We could do the same since that no response.

Or I can force merge it if need be

@mzaian
Copy link
Contributor

mzaian commented Feb 9, 2024

@mzaian do you have the write perms on this PR ? I think if we rebase it on master it should work

I cannot remember but I did a cherry-pick and referenced to this PR here https://github.com/kubernetes-sigs/kubespray/pull/10569/files We could do the same since that no response.

Or I can force merge it if need be

We need to rebase to not break other changes. I would suggest a cherry-pick PR with the same stuff since that he is not available.

@VannTen
Copy link
Contributor

VannTen commented Feb 9, 2024

Doesn't Github allow repo maintainers to push on PR branch ? So we could the rebase ourselves.

@mzaian
Copy link
Contributor

mzaian commented Feb 9, 2024

Doesn't Github allow repo maintainers to push on PR branch ? So we could the rebase ourselves.

This has to be allowed by the PR owner while he is creating the PR. To allow maintainers to edit the PR.

@VannTen
Copy link
Contributor

VannTen commented Feb 12, 2024

/close
Superseded by #10913 (which is a simple rebase of this one)

@k8s-ci-robot
Copy link
Contributor

@VannTen: Closed this PR.

In response to this:

/close
Superseded by #10913 (which is a simple rebase of this one)

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.

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/bug Categorizes issue or PR as related to a bug. ok-to-test Indicates a non-member PR verified by an org member that is safe 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.

nginx controller leader election failed on certain setup
8 participants