Goal
Allow easy setup of node autoscaling suitable for jupyterhub k8s clusters.
An intro to autoscaling
If we have many users, we will have many singleuser pods, each guaranteed some resources. The more users, the more pods, the more resources required. We might want to add nodes when we are unable to schedule more pods, or perhaps when were are close to being unable to schedule more pods. There are various tools available related to scaling, here is a summary.
Instance group autoscaler (google) - nah...
Does not require or understand kubernetes, so it does not account for kubernetes concepts like pods and their requested resources. It will instead look at CPU load of the nodes and add more nodes when the CPU usage is too high. Not relevant to us, as we want to guarantee users to have a certain set of resources on the node they are scheduled.
Horizontal pod autoscaler - nah...
Will increase the number of pods doing a certain task if needed based on for example CPU utilization. This is relevant if you need more copies of the same pod. Each user should only have one pod, not multiple pods, so scaling up in this way makes little sense for the singleuser pods.
Kubernetes cluster autoscaler (aka CA) (google) - YES
This is the relevant autoscaler! What do we want to scale? The available nodes. When do we want to scale? When we are about to run out of resources to schedule new users, or even when we predict that will happen. The kubernetes cluster autoscaler will add nodes to a cluster if it has pods that cant fit in the previous nodes. Awesome!
该提问来源于开源项目:jupyterhub/zero-to-jupyterhub-k8s