Skip to content

Lua: Fix ExternalName services without endpoints. #13154

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
May 28, 2025

Conversation

neerfri
Copy link
Contributor

@neerfri neerfri commented Apr 3, 2025

Due to kubernetes/kubernetes#114814 kubernetes no longer creates endpoints for services of type ExternalService. This in turn causes an exception when using an ingress that is backed by such service.

Due to #12952 , which I authored, this causes an exception reported in several recent issues that were opened after the new functionality was released.

I'm still puzzled why the e2e tests in https://github.com/kubernetes/ingress-nginx/blob/main/test/e2e/servicebackend/service_externalname.go did not catch those problems on effected versions of Kubernetes.

This is also related to:

What this PR does / why we need it:

We need this to stabilize the behavior of Ingress backend by a service with type ExternalName across different kubernetes versions and going forward.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • CVE Report (Scanner found CVE and adding report)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation only

Which issue/s this PR fixes

fixes #13081

How Has This Been Tested?

Adding tests to the Lua part of the code that was effected covering previously untested behavior and the specific exception from issue #13081

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have added unit and/or e2e tests to cover my changes.
  • All new and existing tests passed.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 3, 2025
@k8s-ci-robot k8s-ci-robot requested review from Gacko and strongjz April 3, 2025 08:22
@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. area/lua Issues or PRs related to lua code labels Apr 3, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @neerfri. 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 /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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 3, 2025
Copy link

netlify bot commented Apr 3, 2025

Deploy Preview for kubernetes-ingress-nginx ready!

Name Link
🔨 Latest commit ee9b312
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-ingress-nginx/deploys/6835db2f896d980008f1dad9
😎 Deploy Preview https://deploy-preview-13154--kubernetes-ingress-nginx.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Gacko
Copy link
Member

Gacko commented Apr 12, 2025

/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 Apr 12, 2025
@Gacko
Copy link
Member

Gacko commented Apr 12, 2025

/triage accepted
/kind bug
/priority important-soon

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority labels Apr 12, 2025
@Gacko Gacko changed the title Fix exception using ExternalName with empty endpoint list Lua: Fix ExternalName services without endpoints. Apr 12, 2025
@Gacko Gacko changed the title Lua: Fix ExternalName services without endpoints. Lua: Fix ExternalName services without endpoints. Apr 12, 2025
@strongjz
Copy link
Member

strongjz commented May 8, 2025

@neerfri Can you look into why the lua test fails?

@strongjz strongjz added this to the release-1.12 milestone May 8, 2025
@Gacko
Copy link
Member

Gacko commented May 27, 2025

Tests are currently failing because we are currently in the progress of releasing a NGINX base image v2.1.1. Don't worry about that.

@neerfri
Copy link
Contributor Author

neerfri commented May 27, 2025

@Gacko Thanks for the notice. I think mine is failing due to problems in code.
I've been trying to get to the bottom of this for a long time already but I'm unable to pinpoint the exact reason.
I have now resorted to "printf debugging" 😂

@neerfri
Copy link
Contributor Author

neerfri commented May 27, 2025

@Gacko @strongjz
Printf debugging proved extremely useful, as always 😂
Lua tests are now passing
I've merged the main branch
I believe this is ready to be reviewed and merged

Have a lovely day ✨

@Gacko
Copy link
Member

Gacko commented May 27, 2025

Hey! Thank you very much! Looks good (and simple) so far. As soon as @strongjz approves my image promotion PRs, we can go on and merge this.

Copy link
Member

@Gacko Gacko left a 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 important-soon
/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 27, 2025
@Gacko
Copy link
Member

Gacko commented May 27, 2025

/cherry-pick release-1.12

@k8s-infra-cherrypick-robot
Copy link
Contributor

@Gacko: once the present PR merges, I will cherry-pick it on top of release-1.12 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.12

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
Copy link
Member

Gacko commented May 27, 2025

/cherry-pick release-1.11

@k8s-infra-cherrypick-robot
Copy link
Contributor

@Gacko: once the present PR merges, I will cherry-pick it on top of release-1.11 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.11

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
Copy link
Member

Gacko commented May 27, 2025

I triggered the tests as the NGINX base image got promoted now. 🙂

@Gacko Gacko force-pushed the fix-issue-13081 branch from fd5e6f7 to ee9b312 Compare May 27, 2025 15:33
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 27, 2025
@Gacko
Copy link
Member

Gacko commented May 27, 2025

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Gacko, neerfri

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 merged commit 76e2f69 into kubernetes:main May 28, 2025
56 of 59 checks passed
@k8s-infra-cherrypick-robot
Copy link
Contributor

@Gacko: new pull request created: #13429

In response to this:

/cherry-pick release-1.12

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.

@k8s-infra-cherrypick-robot
Copy link
Contributor

@Gacko: new pull request created: #13430

In response to this:

/cherry-pick release-1.11

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.

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. area/lua Issues or PRs related to lua code cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression when using ExternalName services
5 participants