pulumi-kubernetes icon indicating copy to clipboard operation
pulumi-kubernetes copied to clipboard

Upgrading an existing Helm Release results in "error: cannot re-use a name that is still in use"

Open dirien opened this issue 3 years ago • 5 comments

What happened?

Hi everyone,

I have the situation, where I want to upgrade an existing Helm release. This release is not deployed via Pulumi.

When I use the helm cli and add the flag --reuse-values everything works as expected.

In Pulumi, it results in error -> error: cannot re-use a name that is still in use

 cilium:
    type: kubernetes:helm.sh/v3:Release
    properties:
      namespace: kube-system
      chart: cilium
      name: cilium
      reuseValues: true
      forceUpdate: true
      version: ${cilium-version}
      repositoryOpts:
        repo: https://helm.cilium.io/
      values:
        hubble:
          ui:
            enabled: true
          relay:
            enabled: true
    options:
      provider: ${k8s-provider}

Could be related to https://github.com/pulumi/pulumi-kubernetes/issues/1727

Steps to reproduce

Create an K8s Cluster and deploy an helm chart via cli.

Try to upgrade it via Pulumi adding the reuseValues flag to it

Expected Behavior

Upgrades the existing Helm Release

Actual Behavior

error: cannot re-use a name that is still in use

Versions used

v3.37.2

Additional context

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

dirien avatar Aug 04 '22 11:08 dirien

I take this issue to be an enhancement request, asking that the Helm Release resource automatically import an existing Helm release. Today we support various import strategies as outlined in the documentation.

A related enhancement would be to improve the error message, e.g. to suggest the use of importation.

EronWright avatar Nov 28 '23 23:11 EronWright

it's a serious problem when you manage a lot of different cluster / provider. if you change the provider for any reason pulumi want to update the release but canno't manage the upgrade correctly

it make me feel the helm feature of pulumi is useless in production context cause it stuck all the stack

didlawowo avatar Dec 03 '23 19:12 didlawowo

I have the same problem with the error "cannot re-use a name that is still in use", and it is blocking me on already installed clusters. One of the failing charts is using timescaledb and uses persistent volumes which have important data, so I cannot just simply delete the Helm release manually with the CLI and let it recreate by Pulumi. I also used the Release Args Parameter "Replace = true" ("Re-use the given name, even if that name is already used. This is unsafe in production"), it gives me the same error. I am using Pulumi.Kubernetes 4.8.1 on .NET Core 6. @EronWright Is there any piece of information I missed to fix this issue?

martinmesserli avatar Feb 27 '24 04:02 martinmesserli

@martinmesserli it sounds like you should import the release by using the import option on the Release resource. This should be non-disruptive.

EronWright avatar Apr 10 '24 20:04 EronWright