Compare Default vs Override Values for Multi-Environment
Validate and compare Helm values files for different environments (dev, staging, production). Detect misspelled keys, type mismatches, and missing overrides.
Detailed Explanation
Multi-Environment Values Management
Helm charts typically have a values.yaml (defaults) and environment-specific override files like values-dev.yaml, values-staging.yaml, and values-prod.yaml. The comparison mode helps catch issues between these files.
Typical File Structure
my-chart/
values.yaml # Defaults
values-dev.yaml # Development overrides
values-staging.yaml # Staging overrides
values-prod.yaml # Production overrides
Example: Default vs Production Override
Default values.yaml:
replicaCount: 1
image:
repository: my-app
tag: "dev-latest"
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 50m
memory: 64Mi
autoscaling:
enabled: false
nodeSelector: {}
values-prod.yaml (override):
replicaCount: 3
image:
tag: "2.1.0"
resources:
limits:
cpu: "1"
memory: 1Gi
requests:
cpu: 500m
memory: 512Mi
autoscaling:
enabled: true
minReplicas: 3
maxReplicas: 20
nodeselector: # Typo! Should be nodeSelector
env: production
What Comparison Detects
- Misspelled keys:
nodeselectoris flagged as a likely typo ofnodeSelector(Levenshtein distance = 1) - Type mismatches: If default has a number but override has a string for the same path
- Unknown keys: Keys in the override that do not exist in defaults are flagged (could be intentional chart extensions or mistakes)
- Override validation: The override values are also checked against Helm best practices
Best Practices
- Keep override files minimal — only include values that differ from defaults
- Use comments to document why each override exists
- Run the validator on each environment file before deployment
- Consider using
helmfileor Argo CD for managing multi-environment values
Use Case
Running a pre-deployment validation pipeline that checks environment-specific overrides against chart defaults to catch typos and type mismatches before they cause deployment failures.
Try It — Helm Values Validator
Related Topics
Validate a Basic Web App values.yaml
Basic Configuration
Validate Kubernetes Resource Limits and Requests
Resource Management
Validate HPA Autoscaling Configuration in Helm
Resource Management
Production Readiness Checklist for Helm Values
Advanced Patterns
Validate Secrets and ConfigMap Patterns in Helm
Advanced Patterns