官术网_书友最值得收藏!

Scaling pods with the horizontal pod autoscaler

It is also possible in recent versions of Kubernetes to scale pods (rather than nodes). This also allows us to scale down to a node pool of zero, that is to scale down to zero if there is no demand for the service while also retaining the ability to scale up with demand.

Combining the two, that is, scaling in both directions allows you to make your application truly elastic. Remember that pods are a Kubernetes concept, so unsurprisingly, such autoscaling is carried out using kubectl rather than gcloud:

  1. To do this, you need to apply a Horizontal Pod Autoscaler (HPA) by using the kubectl autoscale command. The max flag is mandatory, while the min flag is optional. The cpu-percent indicates total CPU utilization:
kubectl autoscale deployment my-app --max=6 --min=4 --cpu-percent=50  
  1. To check any HPA, use the kubectl describe command:
kubectl describe hpa [NAME-OF-HPA] 
  1. Similarly, use the kubectl delete command to remove HPAs:
kubectl delete hpa [NAME-OF-HPA] 
主站蜘蛛池模板: 武平县| 卢氏县| 胶州市| 农安县| 桓台县| 南投市| 宁强县| 大悟县| 汤阴县| 青铜峡市| 北流市| 晴隆县| 张家川| 绥棱县| 漳浦县| 许昌县| 民县| 莱州市| 连城县| 大兴区| 石楼县| 拜城县| 隆化县| 宜川县| 台北县| 茂名市| 衡阳县| 垦利县| 教育| 凤山县| 桂阳县| 谷城县| 临洮县| 浑源县| 湟源县| 镇原县| 安泽县| 高阳县| 色达县| 四川省| 兰溪市|