20

Cannot install the helm chart but when I use raw file generated by helm, I am able to install via kubectl apply.

Following error is displayed when i use helm install myChart . --debug

Error: cannot re-use a name that is still in use
helm.go:88: [debug] cannot re-use a name that is still in use
helm.sh/helm/v3/pkg/action.(*Install).availableName
        helm.sh/helm/v3/pkg/action/install.go:442
helm.sh/helm/v3/pkg/action.(*Install).Run
        helm.sh/helm/v3/pkg/action/install.go:185
main.runInstall
        helm.sh/helm/v3/cmd/helm/install.go:242
main.newInstallCmd.func2
        helm.sh/helm/v3/cmd/helm/install.go:120
github.com/spf13/cobra.(*Command).execute
        github.com/spf13/cobra@v1.1.3/command.go:852
github.com/spf13/cobra.(*Command).ExecuteC
        github.com/spf13/cobra@v1.1.3/command.go:960
github.com/spf13/cobra.(*Command).Execute
        github.com/spf13/cobra@v1.1.3/command.go:897
main.main
        helm.sh/helm/v3/cmd/helm/helm.go:87
runtime.main
        runtime/proc.go:225
runtime.goexit
        runtime/asm_amd64.s:1371

Installing raw file generated by helm with the following command works great but when I run helm install myChart . it gives the above error

helm install myChart . --dry-run > myChart.yaml
kubectl apply -f myChart.yaml
Encycode
  • 530
  • 2
  • 7
  • 18

4 Answers4

44

Use upgrade instead install:

helm upgrade -i myChart .

The -i flag install the release if it doesn't exist.

Marco Caberletti
  • 1,353
  • 1
  • 10
  • 13
9

Another option could be:

  1. List the available helm charts: helm list. E.g.: enter image description here
  2. Delete the required helm chart helm delete phoenix-chart. E.g.: enter image description here
sfl0r3nz05
  • 547
  • 8
  • 14
4

Removing a sh.helm.release.v1.<chart>.v1 kubesecret and trying again was what I had to do.

I searched for the impacting secret with

kubectl get secrets -n <chart-namespace> or

kubectl get secrets --all-namespaces

jws
  • 2,171
  • 19
  • 30
0

works for me - helm uninstall /<chart_name>