helm-operator icon indicating copy to clipboard operation
helm-operator copied to clipboard

Proper way to migrate from Helm Operator v2 only to Helm Operator v3 only

Open derrickburns opened this issue 4 years ago • 11 comments

This is not a bug report as much as it is a plea for help.

How does one convert from using Helm Operator with Helm v2 only support to Helm Operator with Helm v3 only support (ignoring installation).

I tried :

  1. scale down flux and helm operator (helm v2 only) to zero
  2. convert helm using helm 2to3 convert ...
  3. delete flux namespace
  4. install new flux and helm operator (helm v3 only)

And I also tried this without step (2).

The second approach was a disaster. Helm Operator refused to overwrite existing resources. So I had to manually remove them first.

Suggestions?

derrickburns avatar Jan 17 '20 11:01 derrickburns

I would expect the 4 steps you have documented to work as long as the converted releases are written to the secret storage. We actually want to make it possible to automagically migrate resources using 2to3 in one of the future releases.

hiddeco avatar Jan 17 '20 11:01 hiddeco

@derrickburns will keep that in mind while utilizing it, thanks.


@stefanprodan any ideas on what the most straight forward approach would be for users to tell the operator that they want to migrate a release from v2 to v3?

hiddeco avatar Jan 17 '20 22:01 hiddeco

The namespace issue that i mentioned was fixed in a newer version of the plugin.

derrickburns avatar Jan 18 '20 04:01 derrickburns

Very interested in this, I have about 60 clusters to migrate at some point without disturbing the cluster.

mcfearsome avatar Jan 23 '20 17:01 mcfearsome

# install helm3 see  https://helm.sh/docs/intro/install/
# then install 2to3 plugin
helm plugin install https://github.com/helm/helm-2to3

@mcfearsome I had success with this script after installing helm3 and the 2to3 plugin:

    export FLUX_FORWARD_NAMESPACE=flux
    kubectl scale deployment --replicas=0 -n ${FLUX_FORWARD_NAMESPACE} flux-helm-operator
    kubectl scale deployment --replicas=0 -n ${FLUX_FORWARD_NAMESPACE} flux
    kubectl get configmap -n ${FLUX_FORWARD_NAMESPACE} -l "OWNER=TILLER" | awk '{print $1}' | grep -v NAME | cut -d '.' -f1 | uniq | xargs -n1 helm 2to3 -t ${FLUX_FORWARD_NAMESPACE} convert
    kubectl delete ns ${FLUX_FORWARD_NAMESPACE}
    kubectl delete deployment -n ${FLUX_FORWARD_NAMESPACE} flux-helm-operator
    kubectl delete deployment -n ${FLUX_FORWARD_NAMESPACE} tiller-deploy
    kubectl delete deployment -n ${FLUX_FORWARD_NAMESPACE} flux-memcached

derrickburns avatar Jan 23 '20 20:01 derrickburns

Thank you @derrickburns, I'll probably be starting to experiment in the next few days.

mcfearsome avatar Jan 23 '20 21:01 mcfearsome

@mcfearsome Note: If you are using flux to update flux itself, i.e. you have the flux manifests checked into your configuration repo, you need to remove them before deploying your new flux!

derrickburns avatar Jan 25 '20 20:01 derrickburns

When doing this, we are often, but not in all charts getting "failed to upgrade chart for release [kube2iam]: rendered manifests contain a new resource that already exists. Unable to continue with update: existing resource conflict". The resources are of a lot of different kinds. Does anybody know how to enforce an override? This happens only at the initial migration, as far as I can see.

autarchprinceps avatar Jan 27 '20 10:01 autarchprinceps

@derrickburns

@mcfearsome Note: If you are using flux to update flux itself, i.e. you have the flux manifests checked into your configuration repo, you need to remove them before deploying your new flux!

can you expand on this a bit? We currently have flux/helm operator, insteaded as helm releases. You are saying I need to remove these, do what you posted, and then put them back?

Wont that cause all of my releases to get removed/re-created?

jseiser avatar Feb 10 '20 15:02 jseiser

@jseiser

I was specifically referring to the challenge in migrating any service from a non-helm install to a helm-install.

One of the problems with helm3 is that it sometimes will not install a helm chart if the resources that it would install conflict with those already installed. Unfortunately, I cannot give you a good definition of "conflict."

derrickburns avatar Feb 11 '20 04:02 derrickburns

Here is an upgrade guide made by Steven Wade Upgrading to Helm 3 with Flux CD

stefanprodan avatar May 18 '20 08:05 stefanprodan

Sorry if your issue remains unresolved. The Helm Operator is in maintenance mode, we recommend everybody upgrades to Flux v2 and Helm Controller.

A new release of Helm Operator is out this week, 1.4.4.

We will continue to support Helm Operator in maintenance mode for an indefinite period of time, and eventually archive this repository.

Please be aware that Flux v2 has a vibrant and active developer community who are actively working through minor releases and delivering new features on the way to General Availability for Flux v2.

In the mean time, this repo will still be monitored, but support is basically limited to migration issues only. I will have to close many issues today without reading them all in detail because of time constraints. If your issue is very important, you are welcome to reopen it, but due to staleness of all issues at this point a new report is more likely to be in order. Please open another issue if you have unresolved problems that prevent your migration in the appropriate Flux v2 repo.

Helm Operator releases will continue as possible for a limited time, as a courtesy for those who still cannot migrate yet, but these are strongly not recommended for ongoing production use as our strict adherence to semver backward compatibility guarantees limit many dependencies and we can only upgrade them so far without breaking compatibility. So there are likely known CVEs that cannot be resolved.

We recommend upgrading to Flux v2 which is actively maintained ASAP.

I am going to go ahead and close every issue at once today, Thanks for participating in Helm Operator and Flux! 💚 💙

kingdonb avatar Sep 02 '22 19:09 kingdonb