Off-Loading of k8s deployments to different cluster in case of high loads

2/1/2020

Since I am unable to find anything on google or the official docs, I have a question.

I have a local minikube cluster with deployment, service and ingress, which is working fine. Now when the load on my local cluster becomes too high I want to automatically switch to a remote cluster.

Is this possible?

How would I achieve this?

Thank you in advance

EDIT:

A remote cluster in my case would be a rancher Kubernetes cluster, but as long as the resources on my local one are sufficient I want to stay there. So lets say my local cluster has enough resources to run two replicas of my application, but when a third one is needed to distribute the load, it should be deployed to the remote rancher cluster. (I hope that is clearer now)

I imagine it would be doable with kubefed (https://github.com/kubernetes-sigs/kubefed) when using the ReplicaSchedulingPreferences (https://github.com/kubernetes-sigs/kubefed/blob/master/docs/userguide.md#replicaschedulingpreference) and just weighting the local cluster very high and the remote one very low and then setting spec.rebalance to true to distribute it in case of high loads, but that approach seems a bit like a workaround.

-- Ammasic
kubernetes

1 Answer

2/4/2020

Your idea of using Kubefed sounds good but there is an another option: Multicluster-Scheduler.

Multicluster-scheduler is a system of Kubernetes controllers that intelligently schedules workloads across clusters. It is simple to use and simple to integrate with other tools.

To be able to make a better choice for your use case you can read through the Comparison with Kubefed (Federation v2).

All the necessary info can be found in the provided GitHub thread.

Please let me know if that helped.

-- OhHiMark
Source: StackOverflow