The following tutorial covers the steps required to migrate existing K8s workloads into an Ocean cluster.
After you’ve created an Ocean cluster and connected it to your K8s cluster, it is time to migrate and register the workloads (Nodes & Pods) into Ocean so they will be managed by Spotinst.
Instead of manually draining and re-scheduling your K8s pods on new nodes, Spotinst Ocean will completely automate the migration process.
- A K8s cluster running on AWS infrastructure.
- A K8s cluster connected to an Ocean cluster.
- Spotinst Controller version 1.0.44 installed in the cluster
- Kubernetes Cluster Auto-Scaler DeactivatedCaution: In case the Kubernetes Auto-Scaler is active, there will be inconsistency in spinning up new nodes.
After you have successfully completed creating your Ocean cluster, click on “Workload Migration” on the top right corner. Workload Discovery
Spotinst Ocean will automatically detect the workloads (Nodes & Pods) which belong to the Kubernetes cluster associated with it.
In the following screen, Ocean will display all the nodes that it discovered.
- From the list on the left, select the instances you wish to migrate into your Ocean cluster by clicking on the relevant checkbox.
Workload Migration Preferences
- Select your preferred Workload Migration process by selecting the relevant checkbox:
- Terminate Instances – By selecting this checkbox, Spotinst Ocean will terminate the old instances once the pods that reside on them are migrated, and the old instances are fully drained.
- Evict stand-alone Pods – By selecting this checkbox, Spotinst Ocean will terminate pods that don’t belong to a Kubernetes deployment, this practically means that you would need to launch the Pod manually (after the migration) due to the fact that there is no object that would do it automatically.
Note: In case you have Stand-Alone pods and you haven’t selected this checkbox, please note that you will be required to manually evict those pods at the end of the migration process.
- Force PDB covered Pod Eviction – By selecting this checkbox, Spotinst Ocean will force the Pod eviction from the instance, even if the distributed budget is not satisfied.
- Select the batch size (in %) you wish to apply, by toggling the bar.
- After you have selected the relevant instances and decided on the migration scope and batch size, click on “Start Migration” on the bottom right corner in order to begin the process.Note: After clicking on “Start Migration” there will be a pop-up screen where you can have a final review of the migration configuration.
- Click on “Start Migration” to officially begin the migration processNote: Once you have started the migration, you will have the option to stop it, however, please note, that workloads that have been migrated to Spotinst, will remain under the new instances which are managed by Spotinst. This means that when aborting the process will, Spotinst will finish scheduling all unscheduled pods of the current batch, and instances that were not drained yet will become schedulable again.
Workload Migration Dashboard
- The overall status of the migration process:
- Running – The migration process is concurrent and pods are being migrated.
- Stopping – The migration process has been aborted by the user, and Spotinst is gracefully completing the current batch.
- Stopped – The migration process has officially stopped, after completing the stopping phase.
- Completed – The migration process has completed successfully.
- Failed – The migration process has failed due to technical fault during the process.
- The stage of the migration process
- The number of new instances spun up by Spotinst – This number will rise from 0 to X during the first few minutes of the migration process.
- The number of pods launched on new instances – This number will rise as the migration proceeds, please note that Kubernetes might schedule other pods which don’t belong to the workloads being migrated.
- The number of pods remaining to be launched by Spotinst – This number will subtract from X to 0 during the migration process.
- The number of unscheduled pods in the cluster – The number of pods that are currently in an unscheduled state. Spotinst refers only to unscheduled pods which are a part of the workload.
- The instances which have been terminated successfully
- The instances which have completed the migration successfully
- The instances which are currently being drained
- The instances which haven’t started the migration process
Instances Color Status:
- Green: Instance has completed the migration successfully
- Yellow: Instance has partially completed the migration
- Red: Instance has failed the migration
- In case you wish to review previous migrations, please click on “Previous Migrations” on the top right corner of the “Workload Migration” screen.
- In case you wish to abort the migration process, click on “Stop Migration” on the top right corner.
- The following window will pop up, select the checkbox “Terminate Drained Instances” if you want Spotinst Ocean to terminate the already drained instances before aborting the entire process, then select “Yes, Stop”.