Troubleshoot HPA Pod Scaling Blocked by ResourceQuota
Scenario
The billing-api service is running in the finops namespace with a Horizontal Pod Autoscaler (HPA) configured. However, the deployment is not reaching the HPA minimum replica count and remains at 1 pod.
Investigate the ResourceQuota configuration, identify what is causing the scaling issue according to the HPA configuration, and fix it.
Task
The billing-api deployment has an HPA configured with:
minReplicas: 3maxReplicas: 10
Inspect the ResourceQuota in the namespace, determine what is causing autoscaling issues according to the HPA configuration, and make the necessary changes so the deployment can scale according to the configured HPA range.
Wait approximately 1 minute for the environment setup and HPA metrics collection to complete.
Do not delete or modify the HPA or Deployment.
Hint
When pods are not scaling as expected, check not just the HPA but also any namespace-level policies that could be restricting pod creation.
# check HPA status and events
kubectl describe hpa billing-api-hpa -n finops
# list all resources in the namespace
kubectl get all -n finops
# check namespace-level restrictions
kubectl get resourcequota -n finops
kubectl describe resourcequota -n finops