Autoscale on CPU and fix an unknown target
- 12 min
- 5 steps
- Operate and ship
Steps
0 of 5 done
web runs one replica under steady load and api already has an HPA that reports
Step 1 of 5
Create an HPA for the web Deployment that aims for 50% average CPU utilization, with at least 2 and at most 10 replicas.
Checked against the cluster as it changes.
Step 2, not started: web's single pod uses about 400m against a 100m request. Work out the replica count the HPA should settle on, then watch the HPA until it gets there.
Step 3, not started: The api HPA has shown <unknown> since it was created. Find the message the controller gives for it.
Step 4, not started: Give api's container a CPU request of 100m without hand-editing YAML, so its HPA can compute utilization.
Step 5, not started: When web's load drops, it should lose at most one pod per minute. Add a scale-down policy to its HPA that allows that and nothing faster.
Enter runs the command. Tab completes, and the arrow keys recall earlier commands. Control C stops a watch. On an empty line, or after Escape, Tab moves focus out of the terminal.