An enterprise operations team is preparing to enable dynamic workload scaling for a microservice deployed on a Google Kubernetes Engine (GKE) cluster. To ensure accurate autoscaling metric calculations and maintain application availability during scaling events, arrange the following CLI management steps in the correct operational sequence from first to last.
- 1Define container CPU and memory resource requests on the Deployment using `kubectl set resources`.
- 2Establish minimum workload availability bounds by deploying a PodDisruptionBudget with `kubectl create poddisruptionbudget`.
- 3Apply horizontal pod scaling rules to the Deployment using `kubectl autoscale deployment` with target utilization thresholds.
- 4Validate active metrics collection and pod scaling behavior using `kubectl get hpa --watch`.
Answer
The correct operational sequence is: first, set container resource requests using `kubectl set resources`; second, establish a PodDisruptionBudget using `kubectl create poddisruptionbudget`; third, configure the Horizontal Pod Autoscaler using `kubectl autoscale deployment`; fourth, monitor HPA performance using `kubectl get hpa --watch`.
The sequence must start by defining container resource requests via `kubectl set resources` because target utilization percentages in HPA rely on requested CPU/memory values. Next, creating a PodDisruptionBudget ensures availability guards are in place before dynamic scaling occurs. Executing `kubectl autoscale deployment` then creates the HPA controller object. Finally, checking `kubectl get hpa --watch` validates metric ingestion and replica control.
Step-by-Step Solution
Key Concept
GKE Workload Resource Allocation and Autoscaling Sequence