Autoscaling in Google Container Engine

2019-02-04 23:29发布

问题:

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

回答1:

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



回答2:

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