Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm Release - Changing Provided Namespace Deletes but Does not Recreate Resources #2509

Closed
phillipedwards opened this issue Jul 20, 2023 · 2 comments · Fixed by #2532
Closed
Assignees
Labels
area/helm customer/feedback Feedback from customers customer/lighthouse Lighthouse customer bugs and enhancements kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Milestone

Comments

@phillipedwards
Copy link

What happened?

When providing an updated, new namespace to a helm release, the resources within the old namespace are deleted, but are not recreated in the new namespace.

Expected Behavior

Resources should be recreated in the new namespace.

Steps to reproduce

  1. clone https://github.com/phillipedwards/helm-ns-change
  2. deploy the program
  3. change the name of the namespace provided to the Pulumi Helm release
  4. view the new namespace and see no resources exist within the namespace.

Output of pulumi about

CLI
Version 3.74.0
Go Version go1.20.5
Go Compiler gc

Plugins
NAME VERSION
azure-native 2.0.0
kubernetes 4.0.0
nodejs unknown
tls 4.10.0

Additional context

No response

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).

@phillipedwards phillipedwards added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jul 20, 2023
@rquitales
Copy link
Member

Thanks for reporting this issue. I was able to hit this error with a smaller repro code pasted below. Note, moving Helm releases to a new namespace isn't natively supported by the Helm CLI, which is likely why this bug occurs. We'd need to come up with a solution to handle changing ns, likely, having Pulumi do a replacement of the helm Release.

Additional info on helm and changing ns: https://blog.random.io/moving-helm-release-to-another-kubernetes-namespace/

import * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";

// Change the namespace's name to trigger a deletion and recreation of the namespace
// the expectation is k8s resources in a namespace will be deleted before the namespace is deleted.
// The new namespace will then be created and all relevant k8s resources
// The new namespace is created however any resources within that namespace are not created.
const ns = new k8s.core.v1.Namespace("ns", {
    metadata: {
        name: "wp"
    }
});

new k8s.helm.v3.Release("rabbitmq", {
    chart: "rabbitmq",
    namespace: "myns",
    version: "12.0.8",
    createNamespace: false,
    repositoryOpts: {
        repo: "https://charts.bitnami.com/bitnami"
    },
});

@rquitales rquitales added area/helm and removed needs-triage Needs attention from the triage team labels Jul 24, 2023
@phillipedwards
Copy link
Author

phillipedwards commented Jul 28, 2023

@rquitales with the Helm behavior of not being able to handle a namespace replacement, can we via schema enforce a release replacement when the provided namespace changes? Users could set replaceOnChanges but would be nice to set that as default value, if possible.

@mnlumi mnlumi added customer/feedback Feedback from customers customer/lighthouse Lighthouse customer bugs and enhancements labels Aug 2, 2023
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Aug 11, 2023
@mikhailshilkov mikhailshilkov added this to the 0.93 milestone Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/helm customer/feedback Feedback from customers customer/lighthouse Lighthouse customer bugs and enhancements kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants