feat: add --expose-nodeports flag to cluster create - #1698
Open
ChrisJr404 wants to merge 1 commit into
Open
Conversation
Convenience flag that maps the whole default k3s NodePort range (30000-32767) to the same port range on the server node, so people no longer have to remember the full -p mapping. Opt-in, off by default. Closes k3d-io#326
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an
--expose-nodeportsflag tok3d cluster create. When set, it maps the whole default k3s NodePort range (30000-32767) to the same port range on the host, onserver:0. It's just a shorthand for--port 30000-32767:30000-32767@server:0, which is the manual workaround we already document.Off by default, so nothing changes unless you pass the flag.
Why
Closes #326. This came up a while back (the portainer video etc.) and the conclusion in the issue was to add an optional flag rather than exposing the range by default, since mapping the whole range is expensive. This does exactly that.
Implications
CLI only (cmd/), additive. No change to existing behavior when the flag isn't given. Added a small unit test around applyCLIOverrides and regenerated the cluster create command docs, plus a note in the exposing-services guide.