rancher / turtles

Rancher CAPI extension
https://turtles.docs.rancher.com
Apache License 2.0
51 stars 16 forks source link

Add v1->v3 cluster migration #575

Closed alexander-demicev closed 3 months ago

alexander-demicev commented 3 months ago

What this PR does / why we need it: This PR allows migrating from V1->V3 cluster without reimporting the clusters. Rancher already creates a V3 cluster for every V1 cluster. V3 cluster controller will check that V1 cluster includes a migrated annotation or exists at all for a given v3 cluster if the annotation is present, the reconciliation will continue as expected. Users are required to set proper labels on the existing V3 cluster before migrating, this will be described in the ADR and rancher turtles docs.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #

Special notes for your reviewer:

Checklist:

salasberryfin commented 3 months ago

Thanks @alexander-demicev, LGTM. I pushed some minor changes to fix CI checks and I'm fixing E2E tests locally and will be pushing an update too.

furkatgofurov7 commented 3 months ago

@alexander-demicev is this a duplicate of https://github.com/rancher/turtles/pull/576 ?

salasberryfin commented 3 months ago

Hey @furkatgofurov7, #576 implements the approach presented by @Danil-Grigorev, which will be considered the primary migration method. The changes proposed in this PR will allow us to also support manual migration of clusters and it will also help with avoiding breaking clusters when users do not follow the proper migration procedure, i.e. prevent from creating duplicate resources to represent the same CAPI cluster.

salasberryfin commented 3 months ago

Thanks for the review @Danil-Grigorev. Only E2E is pending for this to be ready to be merged.