One of the critical capabilities of any container orchestrator is the ability to automatically scale both your application and the hosting environment itself. AKS handles this through the combination of the Kubernetes Horizontal Pod Autoscaler(HPA) and the AKS Cluster Autoscaler.
To emulate user load, this workshop recommends the use of Azure Load Testing.
Familiarize yourself with the HPA, Cluster Autoscaler and Azure Load Testing, review the requirements and complete the tasks.
- Cluster autoscaler should be enabled on both the System and User mode nodepools
- System pool should have a min count of 1 and max count of 3
- User pool should have a min count of 0 and a max count of 3
- Since were rapid testing we want the cluster autoscaler to:
- Scan every 5 seconds for scale up
- Scale down when a node isn't needed for 1 minute
- Allow scale down 1m after scale up
- Use a tool to generate load (e.g.: Apache Benchmark, jMeter, wrk, artillery, k6, Azure Load Testing) to test the performance of the application.
- Configure autoscaling for all nodepools based on the requirements above
- Validate pod autoscaling is working
- Validate cluster autoscaling is working
Useful links:
- AKS Cluster Autoscaler
- Automatically scale a cluster to meet application demands on Azure Kubernetes Service (AKS)
- Examine the node and pod health
- Horizontal Pod Autoscaling
- Horizontal Pod Autoscaler Walkthrough
- How to query logs from Container insights
- Reserve Compute Resources for System Daemons
- Safely Drain a Node
- Quickstart: Create and run a load test with Azure Load Testing Preview
- Auto-Scaling with Horizontal Pod Autoscaler and Cluster Autoscaler