2.4 KiB
2.4 KiB
Helm Best Practices
This skill provides Helm chart development and maintenance patterns.
When to Use
Activates when:
- Working with Helm charts
- Modifying Chart.yaml dependencies
- Updating Helm values
- Deploying applications with Helm
Dependency Management
Critical Rules
Always use helm dependency update - NOT helm dependency build
# Correct
helm dependency update
# Wrong - Don't use this
helm dependency build
After changing Chart.yaml dependencies:
- Run
helm dependency updateto fetch updated dependencies - Run
make check-depsbefore committing changes - Pre-commit hooks automatically rebuild dependencies
Common Workflow
# 1. Modify Chart.yaml
vim Chart.yaml
# 2. Update dependencies
helm dependency update
# 3. Check dependencies
make check-deps
# 4. Commit changes (pre-commit hook runs automatically)
git add Chart.yaml Chart.lock charts/
git commit -m "update helm dependencies"
Helm Commands
Testing Charts
# Template and check output
helm template <release-name> <chart-path>
# Template with specific values
helm template <release-name> <chart-path> -f values.yaml
# Dry-run install
helm install <release-name> <chart-path> --dry-run --debug
Debugging
# Check current values
helm get values <release-name>
# Check all computed values
helm get values <release-name> --all
# Get manifest
helm get manifest <release-name>
Best Practices
Chart Structure
- Keep templates focused and modular
- Use helpers (
_helpers.tpl) for repeated logic - Document all values in
values.yamlwith comments - Use semantic versioning for chart versions
Values Organization
- Use nested structures for related values
- Provide sensible defaults
- Document required vs optional values
- Use
.Valuesconsistently
Dependency Management
- Pin dependency versions explicitly
- Use repository URLs, not local paths in production
- Keep
Chart.lockin version control - Run
make check-depsbefore committing
Common Gotchas
❌ Don't:
- Use
helm dependency build(useupdateinstead) - Forget to run
make check-depsbefore committing - Commit without running pre-commit hooks
- Hard-code values that should be configurable
✅ Do:
- Use
helm dependency updatefor dependency changes - Run
make check-depsas part of your workflow - Let pre-commit hooks rebuild dependencies automatically
- Make values configurable and well-documented