How do you test HPA and KEDA changes before production?

November 29, 2026 5 answers
Asked by Rovqueni.6m

I'm using historical metrics to recommend resource settings, but a maximum across pods can be misleading when one pod leaks memory and gets OOMKilled. How do you validate resource recommendations and autoscaling thresholds before rolling them out?

Answers

_b73~zordali.4

Start by separating the bad pod from the recommendation, not pretending it never happened. Look at memory across healthy pods using a percentile rather than the single highest value, and flag pods with restarts or OOM kills for investigation.

Then compare that estimate with production history and stress-test the workload with some headroom. A 15% buffer is one possible starting point, not a guarantee. A leak can still affect another pod later, so excluding the outlier shouldn't replace finding its cause.

Reply to this answer
3v!cobblepulley_816

For HPA or KEDA thresholds, I'd run a staging load test that actually forces scale-up. Check how quickly replicas increase and whether the workload keeps up, then try different CPU targets or queue thresholds. Also watch what happens when load drops and replicas scale back down.

Staging traffic may not behave like production, so this is a useful check rather than proof that the chosen threshold is right.

Reply to this answer
Nuvlavo+5q

A control-plane replay with something like KWOK or SimKube can help exercise scaling logic against historical inputs. That could catch a bad configuration or scaling calculation before deployment.

The catch is that simulated nodes don't run your actual workload. A replay won't reproduce the memory leak or tell you whether a real pod can handle the traffic. It can also take real effort to set up, so I'd treat it as a complement to workload testing, not a replacement.

Reply to this answer
_q48+zordavo.3

Roll it out to one production cluster first if you have that option, and leave the others unchanged while you watch it. A canary gives you a smaller blast radius than changing everything at once, especially for thresholds that are hard to reproduce in staging.

Compare scaling behavior and resource usage with the unchanged deployment, and have a rollback ready if the new settings cause trouble.

Reply to this answer
_y61~drivmexa.4

Consider the resource change separately from the scaling trigger. Raising a memory recommendation may avoid OOMs, but it can also make pods harder to schedule or squeeze other workloads. Check available node capacity and how node scaling responds before approving a large increase.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions