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

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] 
主站蜘蛛池模板: 万宁市| 饶阳县| 城口县| 绵阳市| 石城县| 金华市| 手游| 彭州市| 清苑县| 石门县| 林西县| 甘孜县| 美姑县| 大港区| 文成县| 博爱县| 丹寨县| 通州区| 博客| 镶黄旗| 利津县| 永善县| 定日县| 呼图壁县| 呼玛县| 清苑县| 新绛县| 湄潭县| 泸溪县| 德钦县| 揭西县| 芦山县| 上思县| 响水县| 临漳县| 名山县| 乌审旗| 白玉县| 建宁县| 长治县| 洪雅县|