Autoscaling in Google Container Engine

前端 未结 3 788
执笔经年
执笔经年 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.

提交回复
热议问题