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

feat: allow migrate from HelmChart v1beta1 to v1beta2 if Helm --take-ownership is set #5046

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

nvanthao
Copy link
Member

@nvanthao nvanthao commented Dec 12, 2024

What this PR does / why we need it:

We currently don't allow migration from existing Helm installation of v1beta1 with useHelmInstall: false to Helm v1beta2.

As Helm CLI will soon support --take-ownership flag, this will be possible.

This PR allows the application pull for Helm chart with same name in v1beta2, as long as there is --take-ownership flag in Helm additional upgrade flags.

Demo: https://www.loom.com/share/db17e620509843d884fbcf98605daaed?t=281

If no --take-ownership flag, pull will fail during update checks

image

Which issue(s) this PR fixes:

Story: https://app.shortcut.com/replicated/story/117029/add-keep-annotation-to-kots

Does this PR require a test?

NONE

Does this PR require a release note?

NONE

We will need a release note later when upstream Helm CLI supports --take-ownership flag.

Does this PR require documentation?

Current docs will have to be updated after the change is merged and upstream Helm CLI supports --take-ownership flag

@nvanthao nvanthao added the type::feature New feature or request label Dec 12, 2024
@xavpaice
Copy link
Member

This needs to be merged alongside updating Helm to either use the version with --take-ownership merged and released, or our fork of it that does.

@nvanthao
Copy link
Member Author

I've updated the PR with fetching from Helm PR that supports --take-ownership and build it.

@nvanthao nvanthao force-pushed the gerard/f-helm-migrate branch 2 times, most recently from edda4b7 to c0daf44 Compare December 19, 2024 02:33

pipeline:
- runs: |
set -x
export DESTDIR="${{targets.destdir}}"
mkdir -p "${DESTDIR}"

# Build Helm from PR 13439
# to be removed later when latest Helm supports --take-ownership flag
git clone --depth 1 https://github.com/helm/helm.git
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and use a specific commit

@@ -59,6 +72,5 @@ pipeline:
mv bin/kotsadm "${DESTDIR}/kotsadm"
mv bin/kots "${DESTDIR}/kots"

ln -s /usr/bin/helm ${DESTDIR}/usr/local/bin/helm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll also need to remove the helm binary from the apko file: https://github.com/replicatedhq/kots/blob/main/deploy/apko.yaml.tmpl#L16

git checkout pr-13439
make
chmod a+x bin/helm
mv bin/helm "${DESTDIR}/usr/local/bin/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to run mkdir -p ${DESTDIR}/usr/local/bin/ first. which is why CI is failing

@nvanthao nvanthao force-pushed the gerard/f-helm-migrate branch from c0daf44 to 2ebd087 Compare December 19, 2024 22:25
@nvanthao nvanthao requested a review from sgalsaleh December 20, 2024 05:25
@nvanthao
Copy link
Member Author

Many thanks @sgalsaleh! I have made the requested changes accordingly and notice the Melange and Apko actions completed successfully. Please let me know how it goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants