How to migrate from non-rancher launched k8s cluster to a rancher launched k8s cluster

There would be many development teams who used to have their own kubernetes cluster (on-premise or cloud) before they discover Rancher! (like our team :smiley: )

I know Rancher allows us to import an existing cluster (non Rancher launched), but given the fact that for these imported clusters users would not get cool features like taking/restoring snapshots, updating the cluster from rancher UI or cluster.yml fileā€¦ there would be this strong tendency to replace the existing imported cluster with a rancher launched cluster. Right?

Wellā€¦the challenge is that nobody likes down time for the apps and services.
I know we have the concept of etcd and everything to recover a cluster and the workloads.

But I would like to suggest to the Rancher community to come up with a step to step instruction documented in Rancher website about
How to nicely and cleanly migrate from an existing non Rancher launched k8s cluster to a Rancher launched k8s cluster without down time

I think this would be important

This isnā€™t really possible. When you import a cluster the rancher agent is running ā€œinsideā€ that cluster and has no real access to the stuff that lives in the ā€œoutsideā€, like etcd, The underlying nodes, the particular kubernetes version that is running, how that was installed, etc.

Those things also may not exist at all (e.g. there is no etcd with k3s) and there is no good way to look at an arbitrary machine and know how the binaries that are running (assuming you could get to the nodes) were definitely installed. Or how to upgrade them; you could have used RKE, kubeadm, a dozen other installers, distro packages, compiled binaries yourself, a hosted provider like GKE where the control plane is invisible, etc.

I know it is impossible for Racher to handle all that, and I am not expecting it either.
There would be probably some manual actions and commands for such a migration. But, I am hopping to get a guide line from Rancher community (as kubernetes experts) about how to this and what are the recommended steps to take (manual actions)

Like is it possible to backup your etcd database from the old database and load it on the new Rancher launched cluster? probably it is possible, but the question is how?

Providing such a guide line help us easier to move to Rancher managed clusters

Thanks

This is also something I am after.
All my existing clusters are built with RKE
Even though rancher use rke under the hood to launch kubernetes clusters, the imported clusters still cannot have the nice features of snapshots.

Iā€™d prefer to build all my kubernetes clusters with terraform rke provider and them import them to rancher, which would give me more control of the EC2 instances. But I really like the snapshot feature.

1 Like