05 scale cce
Prerequisites
HPA(HorizontalPodAutoscaler) can increase and decrease pods according to policies.
When the node resources under the cluster are insufficient or wasted, CA can increase and decrease Node according to the policy.
To use HPA, you need to install an add-on that provides metrics APIs. Select one of the following add-ons based on your cluster version and actual requirements.
- metrics-server: provides basic resource usage metrics, such as container CPU and memory usage. It is supported by all cluster versions.
- kube-prometheus-stack: provides custom metrics in addition to basic resource metrics. You need to register Prometheus as the service that provides metrics API. For details, see Providing Resource Metrics Through the Metrics API. This add-on supports clusters of v1.17 or later.
Before using the node scaling function, you must install the autoscaler add-on of v1.13.8 or later.
HPA(HorizontalPodAutoscaler) test
HPA mechanisim
Run a demo deployment(Run and expose php-apache server)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
Resource Management for Pods and Containers
create the deployment
1 2 3 4 5 6 7 8 9 |
|
Install the metrics-server plug-in, and add a loop access test to the corresponding load to mode high concurrent requests.
We can view the expansion and contraction process through the log.
Command operation is difficult for many people, but the graphical interface will be much simpler. CCE supports both command operation and easier click configuration through the web interface.
Huaweicloud CCE support customedHPA, we can set more step's actions.
HorizontalPodAutoscaler Walkthrough
Using HPA and CA for Auto Scaling of Workloads and Nodes
CA(Cluster autoscaler)
Create a CCE nodepool, update enable the node pool autoscaling.
Configure the node scaling rules:
Elastic Scaling of CCE Pods to CCI
Elastic Scaling of CCE Pods to CCI
捐赠本站(Donate)
如您感觉文章有用,可扫码捐赠本站!(If the article useful, you can scan the QR code to donate))