Autoscaling in Google Container Engine

11/13/2014

I understand the Container Engine is currently on alpha and not yet complete.

From the docs I assume there is no auto-scaling of pods (e.g. depending on CPU load) yet, correct? I'd love to be able to configure a replication controller to automatically add pods (and VM instances) when the average CPU load reaches a defined threshold.

Is this somewhere on the near future roadmap?

Or is it possible to use the Compute Engine Autoscaler for this? (if so, how?)

-- Daniel
google-kubernetes-engine
kubernetes

3 Answers

11/13/2014

As we work towards a Beta release, we're definitely looking at integrating the Google Compute Engine AutoScaler.

There are actually two different kinds of scaling:

  1. Scaling up/down the number of worker nodes in the cluster depending on # of containers in the cluster
  2. Scaling pods up and down.

Since Kubernetes is an OSS project as well, we'd also like to add a Kubernetes native autoscaler that can scale replication controllers. It's definitely something that's on the roadmap. I expect we will actually have multiple autoscaler implementations, since it can be very application specific...

-- brendan
Source: StackOverflow

6/5/2016

Kubernetes autoscaling: http://kubernetes.io/docs/user-guide/horizontal-pod-autoscaling/

kubectl command: http://kubernetes.io/docs/user-guide/kubectl/kubectl_autoscale/

Example: kubectl autoscale deployment foo --min=2 --max=5 --cpu-percent=80

-- Eyal Levin
Source: StackOverflow

2/6/2019

You can autoscale your deployment by using kubectl autoscale.

Autoscaling is actually when you want to modify the number of pods automatically as the requirement may arise.

kubectl autoscale deployment task2deploy1 –cpu-percent=50 –min=1 –max=10

kubectl get deployment task2deploy1

NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE

task2deploy1 1 1 1 1 49s

As the resource consumption increases the number of pods will increase and will be more than the number of pods you specified in your deployment.yaml file but always less than the maximum number of pods specified in the kubectl autoscale command.

kubectl get deployment task2deploy1

NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE

task2deploy1 7 7 7 3 4m

Similarly, as the resource consumption decreases, the number of pods will go down but never less than the number of minimum pods specified in the kubectl autoscale command.

-- Shifali Srivastava
Source: StackOverflow