HPA (Horizontal Pod Autoscaler) scales the number of pods based on metrics (CPU, memory, custom). Cluster Autoscaler scales the number of nodes in the cluster when pods can’t be scheduled due to lack of resources. They often work together: HPA adds pods, Cluster Autoscaler adds nodes if needed.
Expanding on the short answer — what usually matters in practice:
A tiny example (an explanation template):
// Example: discuss trade-offs for "kubernetes-autoscaling:-hpa-vs-cluster-autoscale"
function explain() {
// Start from the core idea:
// HPA (Horizontal Pod Autoscaler) scales the number of pods based on metrics (CPU, memory, c
}