Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if a Helm release exists before running the helm uninstall command

I want to add a condition in helm uninstall command in Azure devops pipeline if only a release(infra) is already there i want to uninstall it. How can i do that?

- task: HelmDeploy@0
        displayName: Helm uninstall test
        inputs:
          connectionType: Kubernetes Service Connection
          kubernetesServiceEndpoint: dev-test
          command: uninstall
          chartType: FilePath
          chartPath: infra
          waitForExecution: true
          namespace: test
          arguments: infra
        continueOnError: true
like image 579
Ukchat Avatar asked Nov 18 '25 10:11

Ukchat


1 Answers

You just need to pass --ignore-not-found option to helm uninstall command (see official docs).

Like this:

helm uninstall <MY_RELEASE_NAME> -n <MY_K8S-NAMESPACE> --ignore-not-found
like image 80
Igor Kuznetsov Avatar answered Nov 20 '25 05:11

Igor Kuznetsov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!