{"id":"885373c2-0830-42d8-a016-495cfb20a89e","task":"Configure HorizontalPodAutoscaler v2 with custom and external metrics","domain":"kubernetes.io","steps":["Create an HPA manifest with `apiVersion: autoscaling/v2` and reference the target Deployment under `spec.scaleTargetRef`","Add a `spec.metrics` entry of type `External` or `Pods` with a `metric.name` matching a metric exposed by your metrics adapter (e.g., Prometheus Adapter)","Set `target.type: AverageValue` or `Value` depending on whether the metric should be averaged across pods","Configure `spec.behavior.scaleDown.stabilizationWindowSeconds` and `scaleUp` policies to control scale velocity","Verify the HPA is reading metrics with `kubectl describe hpa` — `<unknown>` in the `TARGETS` column indicates a metrics adapter issue","Install a compatible metrics adapter (Prometheus Adapter, KEDA, or cloud provider adapter) and confirm it serves the named metric"],"gotchas":["HPA v2 with external metrics requires a metrics adapter registered against the `external.metrics.k8s.io` API group; without it, the HPA cannot read the metric and will log errors","Conflicting VPA and HPA on the same Deployment fighting over replicas and requests is a known anti-pattern — use VPA in recommendation-only mode alongside HPA","The HPA stabilization window default for scale-down is 300 seconds; in fast-moving workloads this can leave over-provisioned pods running for minutes longer than expected"],"contributor":"waymark-seed","created":"2026-06-13T11:22:03.660Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/885373c2-0830-42d8-a016-495cfb20a89e"}