[root@localhost ~]#
[root@localhost ~]# k3s server --kube-apiserver-arg --service-node-port-range=30000-40000
INFO[2020-01-02T10:11:39.463048656+08:00] Starting k3s v1.0.1 (e94a3c60)
INFO[2020-01-02T10:11:39.463464572+08:00] Cluster bootstrap already complete
FATA[2020-01-02T10:11:39.478510983+08:00] starting kubernetes: listen tcp :6443: bind: address already in use
[root@localhost ~]#
You are calling the server daemon from the console... isn't your server already running via systemd?
Related to #444
I added this to the k3s (server) service in /etc/systemd/system/k3s.service in the ExecStart:
'--kube-apiserver-arg' 'service-node-port-range=1-65535' \
@Id2ndR How do you validate the apiserver argument is updated post adding the above in 'k3s.service'?
You'll see it in the k3s log output.
@brandond Thanks. I get below details alwaays from this command k3s server --log testlog.txt .
time="2020-08-19T12:41:03.338058611-05:00" level=info msg="Starting k3s v1.18.6+k3s1 (6f56fa1d)"
time="2020-08-19T12:41:03.340298043-05:00" level=info msg="Cluster bootstrap already complete"
time="2020-08-19T12:41:03.352787485-05:00" level=fatal msg="starting kubernetes: preparing server: start cluster and https: listen tcp :6443: bind: address already in use"
~
Are there any other arggument should be passed to get complete log details? pls. suggest.
This most likely means k3s is already running. Did you mean to edit the systemd unit arguments and restart it, instead of running another copy of it from the command line?
I followed below steps and could see the updated arguments value set.
systemctl stop k3s.service
k3s server --kube-apiserver-arg adverties-port=7000 --log newlog.txt
BTW , where does kube-apiserver or kube-controller-manager configurations stored in K3S. How does K3S service understand the new argument values to consider whenever it is restarted?
I know K8S stores them in file system under /etc/kubernetes/manifests/
Seems like a bug ; Followed below steps
Pls. advise.
Running k3s manually via the command-line with different options doesn't have anything to do with the the systemd unit configuration. You need to edit the actual unit to change the arguments that systemd starts the service with.
Also, don't pass --log when running as a service. Just use journalctl -u k3s to view logs.
systemctl stop k3s
vi /etc/systemd/system/k3s.service # change your configuration, save and quit
systemctl daemon-reload
systemctl start k3s
Most helpful comment
Related to #444
I added this to the k3s (server) service in
/etc/systemd/system/k3s.servicein theExecStart: