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

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] 
主站蜘蛛池模板: 黎城县| 石渠县| 福建省| 宣武区| 新民市| 无为县| 漠河县| 博白县| 盐边县| 珲春市| 嵊州市| 襄汾县| 沅江市| 平湖市| 惠来县| 乳源| 高州市| 上虞市| 富民县| 龙山县| 于田县| 襄垣县| 曲周县| 蕉岭县| 临西县| 大悟县| 陇南市| 迁安市| 若尔盖县| 常宁市| 桑日县| 额敏县| 通榆县| 博湖县| 西吉县| 通江县| 察隅县| 盐源县| 白河县| 泾源县| 韶山市|