- Google Cloud Platform for Architects
- Vitthal Srinivasan Janani Ravi Judy Raj
- 166字
- 2021-06-25 20:48:36
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:
- 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
- To check any HPA, use the kubectl describe command:
kubectl describe hpa [NAME-OF-HPA]
- Similarly, use the kubectl delete command to remove HPAs:
kubectl delete hpa [NAME-OF-HPA]
推薦閱讀
- 同步:秩序如何從混沌中涌現
- Unity 5.x Game AI Programming Cookbook
- R數據科學實戰:工具詳解與案例分析(鮮讀版)
- 數據挖掘原理與SPSS Clementine應用寶典
- Learning Proxmox VE
- 數據庫設計與應用(SQL Server 2014)(第二版)
- Power BI智能數據分析與可視化從入門到精通
- 數據庫技術及應用
- Mastering ROS for Robotics Programming(Second Edition)
- Access 2010數據庫程序設計實踐教程
- 數據庫原理與設計實驗教程(MySQL版)
- Machine Learning for Mobile
- AutoCAD基礎與應用精品教程(2008版)
- Python數據分析入門與實戰
- 新一代信息技術基礎