Which FOUR of the following are valid fields in a HorizontalPodAutoscaler (HPA) v2 specification?
spec.metrics is a list of metric specifications in the autoscaling/v2 HPA API. It defines one or more metrics (resource, container resource, external, or object/pods) that the controller evaluates when computing the desired replica count. Each entry includes a type and target, such as AverageUtilization for CPU. This field replaces v1's single CPU metric, enabling multi-metric scaling where the largest resulting replica count wins.
Why this answer
In HPA v2 (autoscaling/v2), the spec includes 'metrics', 'behavior', 'minReplicas', and 'maxReplicas'. All four of these fields are valid in the v2 specification. 'targetCPUUtilizationPercentage' is a deprecated field from v1 and is not part of the v2 spec. Therefore, options B, C, D, and E are correct.
Exam trap
Candidates might overlook one of the valid fields, but all four spec fields (B, C, D, E) are valid in v2. Ensure you know the correct fields for v2.