Helm 3 install for resouces that exist

i've got the same issue while deploying Istio. So i did

kubectl get clusterrole
kubectl get clusterrolebinging
kubectl delete mutatingwebhookconfiguration istio-sidecar-injector
kubectl delete validatingwebhookconfiguration istio-galley
kubectl delete namespace <istio-namespace>

and when deleted all and started, it worked.


First of all you need to make sure you've successfully uninstalled the helm release, before reinstalling.

To list all the releases, use:

$ helm list --all --all-namespaces

To uninstall a release, use:

$ helm uninstall <release-name> -n <namespace>

You can also use --no-hooks to skip running hooks for the command:

$ helm uninstall <release-name> -n <namespace> --no-hooks

If uninstalling doesn't solve your problem, you can try the following command to cleanup:

$ helm template <NAME> <CHART> --namespace <NAMESPACE> | kubectl delete -f - 

Sample:

$ helm template happy-panda stable/mariadb --namespace kube-system | kubectl delete -f -

Now, try installing again.

Update:

Let's consider that your chart name is mon and your release name is po. Since you are in the charts directory (.) like below:

.
├── mon
│   ├── Chart.yaml
│   ├── README.md
│   ├── templates
│   │   ├── one.yaml
│   │   ├── two.yaml
│   │   ├── three.yaml
│   │   ├── _helpers.tpl
│   │   ├── NOTES.txt
│   └── values.yaml

Then you can skip the helm repo name (i.e. stable) in the helm template command. Helm will use your mon chart from the directory.

$ helm template po mon --namespace mon | kubectl delete -f -