How to uninstall / remove tiller from Kubernetes m

2020-07-16 09:29发布

问题:

I've by mistake installed an unsecured configuration of tiller.

I've tried helm reset but something must have corrupted because now when I try to install helm:

$HELM_HOME has been configured at /home/chris/.helm.
Warning: Tiller is already installed in the cluster.
(Use --client-only to suppress this message, or --upgrade to upgrade Tiller to the current version.)
Happy Helming!

However if I try helm ls I get:

Error: could not find tiller.

So because helm reset is insufficient, or there is some bugs, which resources do I need to delete in order to be able to reinstall helm correctly (helm init)?

回答1:

kubectl delete deployment tiller-deploy -n k8s-tiller
kubectl delete service tiller-deploy -n k8s-tiller
kubectl delete -n=k8s-tiller rs tiller-deploy-6f65cf89

Initially I ran init with the --namespace set as k8s-tiller

This also might be useful:

kubectl get all --all-namespaces | grep tiller


回答2:

Tiller can be uninstalled using the command

helm reset --force

or

helm reset --force --wait

It will force the clean of all resources inside the cluster. With that you are able to run helm init again.



回答3:

I think this is what you looking for:

Remove all sensitive info created for tiller:

kubectl get -n kube-system secrets,sa,clusterrolebinding -o name|grep tiller|xargs kubectl -n kube-system delete
kubectl get all -n kube-system -l app=helm -o name|xargs kubectl delete -n kube-system

First command remove all senstive info that might be left for behind, and the last one removes all workloads (pods,services,deployments,replicasets) filtering by the label app=helm



回答4:

I use SSL between Helm and Tiller, so this worked for me:

kubectl delete deployment tiller-deploy -n kube-system
kubectl delete service tiller-deploy -n kube-system
kubectl delete secret tiller-secret -n kube-system

If you don't delete the secret, you get the "Tiller is already installed on this cluster" error and the certs are not updated (which makes Helm hang).