Validate HPA Autoscaling Configuration in Helm

Check autoscaling settings in Helm values.yaml including minReplicas, maxReplicas, CPU targets, and consistency with replicaCount.

Resource Management

Detailed Explanation

Horizontal Pod Autoscaler (HPA) Configuration

Helm charts commonly include an autoscaling section that controls HPA behavior. Misconfigured autoscaling can cause over-provisioning (wasting money) or under-provisioning (causing outages).

Standard Pattern

autoscaling:
  enabled: true
  minReplicas: 2
  maxReplicas: 10
  targetCPUUtilizationPercentage: 80
  # targetMemoryUtilizationPercentage: 80  # optional

What Gets Validated

  1. minReplicas <= maxReplicas: Validates that minimum is not greater than maximum.
  2. Type correctness: enabled must be boolean, replica counts must be numbers.
  3. replicaCount conflict: When autoscaling is enabled and replicaCount is also set, the validator notes that HPA will override the static replica count.
  4. Resource requirements: HPA requires resources.requests to be set for CPU/memory-based scaling.

Common Mistakes

min > max (error):

autoscaling:
  enabled: true
  minReplicas: 10
  maxReplicas: 5  # ERROR: min > max

Autoscaling enabled with static replicaCount:

replicaCount: 3  # This will be ignored when HPA is active
autoscaling:
  enabled: true
  minReplicas: 2
  maxReplicas: 10

Missing resource requests (HPA won't work):

autoscaling:
  enabled: true
  targetCPUUtilizationPercentage: 80
resources: {}  # No CPU requests = HPA can't calculate utilization

Best Practices

  • Set minReplicas to at least 2 for high availability
  • Set targetCPUUtilizationPercentage between 60-80%
  • Always define resources.requests.cpu when using CPU-based HPA
  • Remove or comment out replicaCount when autoscaling is enabled

Use Case

Preparing a Helm release for production where autoscaling must be correctly configured to handle traffic spikes without exceeding cloud budget constraints.

Try It — Helm Values Validator

Open full tool