You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Problem RFC] HPA Control Loop Fails Due to Missing CPU Requests #812
Hi! This is an RFC I’ve written for a new SREGym benchmark problem as part of my evaluation task for UIUC++ SRSE. It primarily focuses on a Kubernetes HorizontalPodAutoscaler (HPA) control-loop failure. I’ll try to explain the problem I’ve tried to model via a scenario. Consider an HPA which is correctly configured for a user-facing service, but its target pods are missing an effective CPU request. Because a CPU-based HPA calculates usage as a percentage of the pod’s request, it can't compute the metric (source). The HPA drops into a broken state, reporting <unknown>/60%, ScalingActive=False, andFailedGetResourceMetric.
The problem itself is based on a real Kubernetes autoscaling failure mode. This AWS re:Post thread introduced me to the existence of the problem. From here I was then able to find a bunch of other posts and documentation referencing variations of the same issue, some of which I have attached below:
For the SREGym implementation, I’m thinking about using the Hotel Reservation app from the Quiz, specifically targeting its frontend deployment. The fault injection here would deploy a standard HPA (e.g., frontend-capacity), and then remove both requests.cpu and limits.cpu from the frontend container spec. I’m phrasing this as “effective CPU request” because in Kubernetes, if a CPU limit remains while the CPU request is removed, the admitted pod can still end up with an effective CPU request equal to the limit, which would prevent the intended HPA failure from appearing as my testing revealed. I’ve manually validated this on the hotel-reservation/frontend service. Removing the effective CPU request reliably triggers the <unknown>/60% failure state, and putting them back immediately restores the HPA to ValidMetricFound.
Thus a valid mitigation must restore a computable HPA metric. A hacky workaround like manually scaling the deployment shouldn't pass, as it leaves the autoscaler completely broken.
Does this sound like a good problem to implement as a PR? Please let me know if anything needs to be updated or if you have any feedback! I’ll try coding it up soon if all is good.
If I am understanding this correctly, it seems the app itself will remain completely healthy and the agent would need to investigate the HPA to detect the fault. It is quite a unique fault.
This sounds good and will be a welcome addition to our problem list. Excited to see the PR and test how the agent will perform on this!
Yep, that’s exactly the idea! The application pods themselves remain completely healthy here because of which the usual first level checks like kubectl get pods which we did in the quiz do not really reveal any issue immediately. This is because the fault is actually in the autoscaling control loop where because the target pods do not have an effective CPU request, the HPA cannot compute utilization correctly, so failing to scale even when the workload increases on the application. Because of this "quirk" the agent would need to look deeper than metrics like pod health and actually inspect the HPA status, deployment resource requests, and HPA events/conditions to identify the real root cause.
I thought this made the problem quite interesting because the system appears to be completely healthy at the pod/application-health level, but loses elasticity under load due to a Kubernetes control-plane/configuration issue rather than a blatant application crash.
Activity
Saadmrp1038 commentedon May 28, 2026
@MABDz Interesting fault!
If I am understanding this correctly, it seems the app itself will remain completely healthy and the agent would need to investigate the HPA to detect the fault. It is quite a unique fault.
This sounds good and will be a welcome addition to our problem list. Excited to see the PR and test how the agent will perform on this!
MABDz commentedon May 28, 2026
Yep, that’s exactly the idea! The application pods themselves remain completely healthy here because of which the usual first level checks like
kubectl get podswhich we did in the quiz do not really reveal any issue immediately. This is because the fault is actually in the autoscaling control loop where because the target pods do not have an effective CPU request, the HPA cannot compute utilization correctly, so failing to scale even when the workload increases on the application. Because of this "quirk" the agent would need to look deeper than metrics like pod health and actually inspect the HPA status, deployment resource requests, and HPA events/conditions to identify the real root cause.I thought this made the problem quite interesting because the system appears to be completely healthy at the pod/application-health level, but loses elasticity under load due to a Kubernetes control-plane/configuration issue rather than a blatant application crash.
tianyin commentedon May 29, 2026
This is an interesting one.
It's great to see that students are looking deeper and deeper into resource management and in particular CPU autoscaling.
CPU autoscaling is in fact rather tricky.
@varuni7 also submitted a problem #807 on CPU limit. I would encourage you to read it.
@
MABDz commentedon May 30, 2026
Implemented in PR #820.