Daniel
Daniel

Reputation: 2117

Autoscaling in Google Container Engine

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?)

Upvotes: 9

Views: 2465

Answers (3)

Shifali Srivastava
Shifali Srivastava

Reputation: 99

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.

Upvotes: 1

Eyal Levin
Eyal Levin

Reputation: 18474

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

Upvotes: 3

brendan
brendan

Reputation: 4136

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...

Upvotes: 7

Related Questions