Version:
k3s version v1.0.0 (18bd921c)
Describe the bug
I am unable to disable the build-in traefik load balancer.
To Reproduce
According to documentation all files in /var/lib/rancher/k3s/server/manifests are automatically deployed. I have removed the traefik.yaml file from this folder and changed /etc/systemd/system/k3s.service, followed by systemctl daemon-reload (everything as root user, of course).
The new service file has these lines in it:
ExecStart=/usr/local/bin/k3s \
server \
--docker \
--no-deploy traefik \
Restart k3s service with service k3s stop && service k3s start. (yes, I also tried service k3s restart)
Expected behavior
Expected kubectl -n kube-system get pods to not list traefik pod.
Actual behavior
The pod is still restarted on each service restart.
Additional context
Ubuntu 19.10 with Docker 19.03.2.
I think you'll have to manually remove the resources defined by traefik.yaml. Removing the manifest and restarting won't remove any resources that already exist.
I guess then the official documentation is somewhat misleading. It says in docs:
To disable it [Traefik], start each server with the --no-deploy traefik option.
Obviously when installing k3s with the install script this is not enough. I also have to remove the previously created resources. I haven't checked it, but is there a configuration switch in the install.sh script that prevents deploying resources to the cluster during initial setup?
For the record and future me, this is what needs to be done to disable Traefik during initial setup:
kubectl -n kube-system delete helmcharts.helm.cattle.io traefiksudo service k3s stopsudo nano /etc/systemd/system/k3s.service and add this line to ExecStart: --no-deploy traefik \
sudo systemctl daemon-reloadsudo rm /var/lib/rancher/k3s/server/manifests/traefik.yamlsudo service k3s start @riker09 you can still use the no-deploy with the install script, you just need to run the command as follows:
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server --no-deploy traefik" sh
This will configure the server with no traefik and you wont find it in the manifests
thats also described here in the docs https://rancher.com/docs/k3s/latest/en/installation/install-options/#installation-script-options
Use the --no-deploy traefik flag and value when installing. Please let us know if there are any other questions / concerns.
Just updating to mention that --no-deploy is deprecated, and now people referring to this should use --disable instead.
Most helpful comment
For the record and future me, this is what needs to be done to disable Traefik during initial setup:
kubectl -n kube-system delete helmcharts.helm.cattle.io traefiksudo service k3s stopsudo nano /etc/systemd/system/k3s.serviceand add this line toExecStart:sudo systemctl daemon-reloadsudo rm /var/lib/rancher/k3s/server/manifests/traefik.yamlsudo service k3s start