Skip to content

Add support for named ports#222

Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
gavinkflam:main
May 12, 2025
Merged

Add support for named ports#222
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
gavinkflam:main

Conversation

@gavinkflam
Copy link
Copy Markdown
Contributor

@gavinkflam gavinkflam commented May 5, 2025

What type of PR is this?

/kind feature

What this PR does / why we need it:

Support converting ingress rules with named ports.

Which issue(s) this PR fixes:

Fixes #209

Does this PR introduce a user-facing change?:

The proposed change includes the following steps:

  1. Read service definitions at the same time as we read ingresses. (resource readers)
  2. Construct a mapping from port names to port numbers for each service.
  3. Use this mapping to resolve port name references into port numbers.
Add support for named ports

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 5, 2025
@k8s-ci-robot k8s-ci-robot requested review from Xunzhuo and levikobi May 5, 2025 00:20
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @gavinkflam!

It looks like this is your first PR to kubernetes-sigs/ingress2gateway 🎉. 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/ingress2gateway 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 May 5, 2025
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @gavinkflam. 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.

Details

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 the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label May 5, 2025
@zirain
Copy link
Copy Markdown
Contributor

zirain commented May 6, 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 May 6, 2025
@LiorLieberman
Copy link
Copy Markdown
Member

/cc

@k8s-ci-robot k8s-ci-robot requested a review from LiorLieberman May 6, 2025 18:00
Copy link
Copy Markdown
Member

@LiorLieberman LiorLieberman left a comment

Choose a reason for hiding this comment

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

Thanks for picking this up @gavinkflam !

Mind updating the PR description with the logic you added?

Also, cross ref kubernetes-sigs/gateway-api#2420 for why named ports are not supported.

Comment thread pkg/i2gw/providers/common/utils.go
@gavinkflam
Copy link
Copy Markdown
Contributor Author

gavinkflam commented May 6, 2025

Thanks @LiorLieberman! I've updated the description to include an explanation of the implementation.

So upstream chose not to support named ports consciously. If that’s the case, it becomes even more important for us to support automatic migration via ingress2gateway.

@gavinkflam gavinkflam requested a review from LiorLieberman May 7, 2025 01:20
Copy link
Copy Markdown
Member

@LiorLieberman LiorLieberman left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

/hold in case @robscott have other opinions

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 7, 2025
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 7, 2025
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gavinkflam, LiorLieberman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 May 7, 2025
@robscott
Copy link
Copy Markdown
Member

Thanks @gavinkflam!

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 12, 2025
@k8s-ci-robot k8s-ci-robot merged commit 312bd89 into kubernetes-sigs:main May 12, 2025
4 checks passed
rajashish pushed a commit to rajashish/ingress2gateway1 that referenced this pull request Feb 21, 2026
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/feature Categorizes issue or PR as related to a new feature. 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. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error for named ports

5 participants