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

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] 
主站蜘蛛池模板: 黑龙江省| 尼木县| 西畴县| 广昌县| 连江县| 藁城市| 日土县| 石城县| 侯马市| 荔波县| 富锦市| 阿坝县| 库伦旗| 佛冈县| 黄骅市| 建始县| 西畴县| 大同市| 油尖旺区| 黎川县| 当阳市| 拜城县| 万荣县| 会昌县| 桃江县| 绥阳县| 西充县| 东城区| 阿拉善盟| 依兰县| 四子王旗| 广饶县| 安徽省| 阿勒泰市| 和林格尔县| 惠安县| 河源市| 武城县| 库伦旗| 沛县| 淳安县|