Problem: HPA shows <unknown>
for metrics
Solution:
- Verify metrics-server is running:
kubectl get deployment metrics-server -n kube-system
- Check resource requests are defined in deployment
- Wait 1-2 minutes for metrics collection
Problem: Deployment doesn't scale despite high load Possible Solutions:
- Verify HPA configuration:
kubectl describe hpa nginx
- Check if max replicas limit is reached
- Ensure cluster has available resources
- Verify metrics are being collected properly
Problem: Pods being OOMKilled or CPU throttled Solution:
- Adjust resource limits in deployment:
- Increase memory limit above "128Mi"
- Increase CPU limit above "100m"
- Monitor actual resource usage:
kubectl top pods
# Check HPA status
kubectl get hpa nginx -o yaml
# View HPA events
kubectl describe hpa nginx
# Check metrics availability
kubectl get --raw "/apis/metrics.k8s.io/v1beta1/pods"
- Always monitor HPA events during initial setup
- Start with conservative scaling thresholds
- Gradually adjust based on actual usage patterns
- Keep resource requests and limits balanced