Skip to content

feat: add --expose-nodeports flag to cluster create - #1698

Open
ChrisJr404 wants to merge 1 commit into
k3d-io:mainfrom
ChrisJr404:feat/expose-nodeports-flag
Open

feat: add --expose-nodeports flag to cluster create#1698
ChrisJr404 wants to merge 1 commit into
k3d-io:mainfrom
ChrisJr404:feat/expose-nodeports-flag

Conversation

@ChrisJr404

Copy link
Copy Markdown

What

Adds an --expose-nodeports flag to k3d cluster create. When set, it maps the whole default k3s NodePort range (30000-32767) to the same port range on the host, on server: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.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Expose nodeport-range by default or via flag

1 participant