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.confip_local_port_range:sudo sysctl -p to apply the changessudo nano /etc/systemd/system/k3s.serviceExecStart in the following settings to specify service-node-port-rangesudo systemctl daemon-reloadsudo systemctl restart k3sThe 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.