Skip to content
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

the way to change the nodeport #444

Closed
wanggonggong opened this issue May 5, 2019 · 3 comments
Closed

the way to change the nodeport #444

wanggonggong opened this issue May 5, 2019 · 3 comments

Comments

@wanggonggong
Copy link

hi,
can you please tell me How to modify the default port range of nodeport 30000-32767,thanks a lot.

@warmchang
Copy link
Contributor

try this:
k3s server --kube-apiserver-arg --service-node-port-range=20618-20828

@wanggonggong
Copy link
Author

@warmchan this method works very well,thank you very much.

@jacksgt
Copy link

jacksgt commented Dec 28, 2020

Just a little update here for anyone else coming across this issue:

The correct version of the specifying the argument is (as of k3s version v1.19.5+k3s2 (746cf40)):

k3s server --kube-apiserver-arg service-node-port-range=1000-32767

If you installed k3s as a systemd service (the default via get.k3s.io), you can make this change permanent by adding the command line argument to ExecStart in /etc/systemd/system/k3s.service, e.g.:

# ...
ExecStart=/usr/local/bin/k3s \
    server \
    --kube-apiserver-arg service-node-port-range=1000-32767

Then systemctl daemon-reload and systemctl restart k3s.

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

No branches or pull requests

3 participants