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 Chart v4: graceful migration from v3 #3110

Open
awoimbee opened this issue Jul 17, 2024 · 3 comments
Open

Helm Chart v4: graceful migration from v3 #3110

awoimbee opened this issue Jul 17, 2024 · 3 comments
Labels
area/docs Improvements or additions to documentation kind/documentation Improvements or additions to documentation

Comments

@awoimbee
Copy link

awoimbee commented Jul 17, 2024

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

I'm trying to migrate from the helm Chart resource v3 to v4, but pulumi wants to redeploy the helm charts, and since it creates new resources before deleting old ones I get name conflicts.

There should be a clean migration path.
Personally I would be grateful even of a pulumi stack export [...] && sed [...] && pulumi stack import solution.

Affected area/feature

kubernetes.helm.v4.Chart

@awoimbee awoimbee added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Jul 17, 2024
@EronWright
Copy link
Contributor

Sorry for the inconvenience, it is an aspect we'd like to improve upon.

A possible workaround is to use a transform function to apply an "alias" option to each child. The alias option lets you "move" a resource by defining its prior parent URN and its prior name.

@awoimbee
Copy link
Author

Since I don't want to bloat the "codebase" with aliases everywhere I have resorted to stuff like:

pulumi -s <ENV> stack export | sed -E \
    -e 's|urn:(.*)v3:Chart(.*cert-manager.*)::(.*)|urn:\1v4:Chart\2::cert-manager:\3|g' \
    -e 's|urn:(.*)v3:Chart(.+)::(.*cert-manager.*)|urn:\1v4:Chart\2::cert-manager:\3|g' \
    -e 's|v3:Chart::cert-manager"|v4:Chart::cert-manager"|g' \
    > stack.json
pulumi -s <ENV> stack import --file stack.json

The issue is that Chart v4 adds the release name to all resources compared to Chart v3 so sed can't be used alone as a generic migration script, otherwise this technique works great (as long as you up, refresh, up to avoid drift)

@blampe blampe added area/docs Improvements or additions to documentation kind/documentation Improvements or additions to documentation and removed kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Jul 22, 2024
@blampe
Copy link
Contributor

blampe commented Jul 22, 2024

We'd like to add some documentation around how to accomplish this using transforms since it's fairly involved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs Improvements or additions to documentation kind/documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants