Autoscaling in Google Container Engine

前端 未结 3 780
执笔经年
执笔经年 2020-12-30 10:14

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

相关标签:
3条回答
  • 2020-12-30 10:25

    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.

    0 讨论(0)
  • 2020-12-30 10:27

    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

    0 讨论(0)
  • 2020-12-30 10:46

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

    0 讨论(0)
提交回复
热议问题