K3s: Use --no-deploy after the fact

Created on 8 Aug 2019  路  8Comments  路  Source: k3s-io/k3s

Is your feature request related to a problem? Please describe.

Unfortunately our cluster was deployed using the k3s defaults before we really understood the implications of using Traefik's default config. Now, we'd like to use Nginx instead of Traefik.

Is it possible to remove Traefik and/or other services deployed by default without removing the cluster and starting over?

Describe the solution you'd like

A command or process to add --no-deploy to a pre-existing cluster.

Describe alternatives you've considered

We've considered uninstalling the cluster and starting over, but this seems fairly drastic.

Most helpful comment

"kubectl delete -n kube-system helmcharts traefik" would remove the default traefik.

All 8 comments

"kubectl delete -n kube-system helmcharts traefik" would remove the default traefik.

Thanks!

Is it possible to do the same for servicelb?

Trying kubectl delete -n kube-system helmcharts servicelb I get this error:

Error from server (NotFound): helmcharts.helm.cattle.io "servicelb" not found

unless you have services with type=loadbalancer, i think you can just reboot with --no-deploy servicelb

What do you mean by "reboot"?

What do you mean by "reboot"?

would also be interested how to reboot with --no-deploy-servicelb

I had success removing servicelb by executing the install command I originally used again but with --no-deploy servicelb, and then restarting the k3s service.

Any stray servicelb pods can then be manually deleted if they don't disappear.

Thanks @radicand, that worked.

To confirm, with a pre-existing cluster I ran the following:

curl -sfL https://get.k3s.io | sh -s - server --no-deploy traefik --no-deploy servicelb
sudo k3s kubectl get pods --all-namespaces --watch
sudo k3s kubectl delete -n kube-system helmcharts traefik

This will clean up the cluster, but if you reboot... helm will re-install traefik. To resolve this, you'll also need to remove/rename the manifest file:

sudo rm /var/lib/rancher/k3s/server/manifests/traefik.yaml
Was this page helpful?
0 / 5 - 0 ratings