The following methods are common practices and may vary depending on the system environment. If they do not work as expected, please refer to relevant documentation and troubleshooting solutions.
sudo nano /etc/sysctl.conf
ip_local_port_range
:sudo sysctl -p
to apply the changessudo nano /etc/systemd/system/k3s.service
ExecStart
in the following settings to specify service-node-port-range
sudo systemctl daemon-reload
sudo systemctl restart k3s
The default range is 30000-32767
. If adjustments are needed, please refer to the following:
sudo vim /etc/kubernetes/manifests/kube-apiserver.yaml
.--service-node-port-range=<new-range>
in spec.containers.command
.--service-node-port-range=30000-40000
.kube-apiserver
configuration file, use the same parameters as above, and restart the service.We have not tried it yet. If anyone has succeeded, please feel free to submit a PR to add it.