Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why helm upgrade --install failed when previous install is failure?

This is the helm and tiller version:

> helm version --tiller-namespace data-devops
Client: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}

The previous helm installation failed:

helm ls --tiller-namespace data-devops
NAME            REVISION        UPDATED                         STATUS  CHART                   NAMESPACE
java-maven-app  1               Thu Aug  9 13:51:44 2018        FAILED  java-maven-app-1.0.0    data-devops

When I tried to install it again using this command, it failed:

helm --tiller-namespace data-devops upgrade java-maven-app helm-chart --install \
        --namespace data-devops \
        --values helm-chart/values/stg-stable.yaml
Error: UPGRADE FAILED: "java-maven-app" has no deployed releases

Is the helm upgrade --install command going to fail, if the previous installation failed? I am expecting it to force install. Any idea?

like image 766
Agung Pratama Avatar asked Aug 09 '18 06:08

Agung Pratama


People also ask

How do I fix failed helm chart?

You just need to update the last secret related to your release. In it, there is a label called status. Change its value to deployed, then reuse your "helm upgrade --install" command and it will works !

Does helm upgrade also install?

Unchecked deployment There are two ways to install Helm charts using the Helm CLI: helm install and helm upgrade --install . The install sub-command always installs a brand new chart, while the upgrade sub-command can upgrade an existing chart and install a new one, if the chart hasn't been installed before.

What happens with helm upgrade?

This command upgrades a release to a new version of a chart. The upgrade arguments must be a release and chart. The chart argument can be either: a chart reference('example/mariadb'), a path to a chart directory, a packaged chart, or a fully qualified URL.


2 Answers

This is or has been a helm issue for a while. It only affects the situation where the first install of a chart fails and has up to helm 2.7 required a manual delete of the failed release before correcting the issue and installing again. However there is now a --force flag available to address this case - https://github.com/helm/helm/issues/4004

like image 174
Ryan Dawson Avatar answered Oct 17 '22 02:10

Ryan Dawson


Try:

helm delete --purge <deployment> 

This will do the trick

and for helm3 onwards you need to uninstall eg.

helm uninstall <deployment>  -n <namespace>
like image 15
Dhiraj Surve Avatar answered Oct 17 '22 01:10

Dhiraj Surve