Skip to content

[Problem RFC] HPA Control Loop Fails Due to Missing CPU Requests #812

Closed

Description

@MABDz

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:

  1. HPA won't work: FailedGetResourceMetric, confused by having two different deployments sharing the same name of a container kubernetes/kubernetes#95237
  2. https://docs.vertica.com/26.2.x/en/containerized/troubleshooting/vas/
  3. HPA on deployments containing dapr sidecar cpu issue dapr/dapr#7813

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.

Activity

  1. Saadmrp1038 commented on May 28, 2026

    @Saadmrp1038
    Collaborator

    @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!

  2. MABDz commented on May 28, 2026

    @MABDz
    ContributorAuthor

    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.

  3. tianyin commented on May 29, 2026

    @tianyin
    Contributor

    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.

    @

  4. MABDz commented on May 30, 2026

    @MABDz
    ContributorAuthor

    Implemented in PR #820.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions