Migrating to the new import controller based on clusters.management.cattle.io (v3 clusters) means we need to apply changes to the existing Rancher cluster resources to let the new controller identify CAPI clusters as already imported. As described in the migration proposal #573, the v3 controller looks for cluster resources marked with the following labels:
cluster-api.cattle.io/owned is added to all clusters imported via Turtles, even if using the existing clusters.provisioning.cattle.io (v1 clusters) based controller. The other two labels must be added to the existing clusters.management.cattle.io resources to let the new controller's label selector find a match and hence detect that the CAPI cluster is properly imported and no new resource needs to be created.
This PR adds a basic bash script for users to run pre-controller-migration so clusters are labeled accordingly. It simply gets one or multiple namespaces as input and applies labels to all Turtles clusters in that namespace.
We'll also be adding instructions on how to do it manually at the cluster level on a migration guide.
kind/feature
What this PR does / why we need it:
Migrating to the new import controller based on
clusters.management.cattle.io
(v3 clusters) means we need to apply changes to the existing Rancher cluster resources to let the new controller identify CAPI clusters as already imported. As described in the migration proposal #573, the v3 controller looks for cluster resources marked with the following labels:cluster-api.cattle.io/owned
is added to all clusters imported via Turtles, even if using the existingclusters.provisioning.cattle.io
(v1 clusters) based controller. The other two labels must be added to the existingclusters.management.cattle.io
resources to let the new controller's label selector find a match and hence detect that the CAPI cluster is properly imported and no new resource needs to be created.This PR adds a basic bash script for users to run pre-controller-migration so clusters are labeled accordingly. It simply gets one or multiple namespaces as input and applies labels to all Turtles clusters in that namespace.
We'll also be adding instructions on how to do it manually at the cluster level on a migration guide.
Which issue(s) this PR fixes: Fixes #
Special notes for your reviewer:
Checklist: