How to uninstall / remove tiller from Kubernetes m

2020-07-16 08:55发布

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)?

4条回答
来,给爷笑一个
2楼-- · 2020-07-16 09:16

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).

查看更多
地球回转人心会变
3楼-- · 2020-07-16 09:20

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.

查看更多
萌系小妹纸
4楼-- · 2020-07-16 09:32
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
查看更多
虎瘦雄心在
5楼-- · 2020-07-16 09:37

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

查看更多
登录 后发表回答