Skip to content

docs: improve NodePort collision section with example and reference #51228

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

J3m3
Copy link
Contributor

@J3m3 J3m3 commented Jun 10, 2025

Description

Changes:

To complement the existing explanation of static and dynamic NodePort bands, add the default range breakdown and a link to the related blog post. This provides users with a clearer understanding and the key information they'd otherwise need to search for separately.

Verified with make container-serve.

To complement the existing explanation of static and dynamic NodePort
bands, add the default range breakdown and a link to a related blog
post. This provides users with a clearer understanding and the key
information they'd otherwise need to search for separately.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 10, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign katcosgrove for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

Copy link

netlify bot commented Jun 10, 2025

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit c80eb2e
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-io-main-staging/deploys/684863acb66772000810cb92
😎 Deploy Preview https://deploy-preview-51228--kubernetes-io-main-staging.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.

@lmktfy
Copy link
Contributor

lmktfy commented Jun 10, 2025

We should be wary to link to https://kubernetes.io/blog/2023/05/11/nodeport-dynamic-and-static-allocation/ unless we're going to mark that page evergreen.

Otherwise, people will follow the link and see:

This article is more than one year old. Older articles may contain outdated content. Check that the information in the page has not become incorrect since its publication.

@J3m3
Copy link
Contributor Author

J3m3 commented Jun 10, 2025

I see your point, thanks for bringing it up. If you feel it's better to leave the link out, I'm happy to drop it. I just thought it might help reduce the need for readers to search elsewhere.

That said, the original documentation does feel a bit abstract, so I think the concrete example could be still helpful for readers. Of course, including specific details always carries the risk of reducing the long-term accuracy if those details change over time (though that seems unlikely in this case).

Do you think it would still be reasonable to include the default range example, and perhaps the port range calculation formula, given that trade-off?

@J3m3
Copy link
Contributor Author

J3m3 commented Jun 10, 2025

Comment on lines +532 to +535
When using the default NodePort range 30000-32767, the bands are partitioned as follows:

- Static band: 30000-30085
- Dynamic band: 30086-32767
Copy link
Contributor

Choose a reason for hiding this comment

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

I might actually put this in https://kubernetes.io/docs/reference/networking/virtual-ips/ anbd link there. Maybe also the information about bands.

Not sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I assume you're referring to placing it near the IP address ranges for Service virtual IP addresses section. That sounds reasonable to me; happy to give it a try and see how it looks.

Copy link
Contributor Author

@J3m3 J3m3 Jun 12, 2025

Choose a reason for hiding this comment

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

Hmm... it turns out it's a bit tricky to find a good place for this change in Virtual IPs and Service Proxies. As the title suggests, that page appears to focus more on how kube-proxy handles internal packet distribution using the virtual IP mechanism through iptables, IPVS, or similar components. Personally, I feel this change is slightly off-topic for that page, since it's specific to the NodePort Service type. That said, I don't have a strong opinion.

It might be helpful to get input from other reviewers. Could you take a look, @nate-double-u @shannonxtreme? (Cc @lmktfy)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language 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.

3 participants