A chart MUST have the following structure:
chart-name/
├── .helmignore # Patterns to ignore when packaging
├── Chart.yaml # Chart metadata
├── values.yaml # Default configuration values
├── values.schema.json # JSON Schema for validating values.yaml
├── templates/ # Template files
│ ├── NOTES.txt # Post-installation notes
│ ├── _helpers.tpl # Common template helpers
│ └── tests/ # Test files
└── README.md # Chart documentation
name
: Must be lowercase and hyphen-separatedversion
: Must follow SemVer 2description
: Must be clear and concisetype
: Must be eitherapplication
orlibrary
home
: URL of the project homepagesources
: List of URLs to source codemaintainers
: List with name and email
-
Structure:
- Use camelCase for keys
- Group related values logically
- Document all values in
values.yaml
-
Defaults:
- Must be production-ready
- Must be secure by default
- Should work out-of-the-box
-
Schema:
- Provide JSON Schema in
values.schema.json
- Define types for all values
- Add descriptions and examples
- Provide JSON Schema in
-
Metadata:
metadata: name: {{ include "chart.fullname" . }} labels: {{- include "chart.labels" . | nindent 4 }}
-
Helper Functions:
- Use
_helpers.tpl
for common functions - Document each helper function
- Test helper functions
- Use
-
Resources:
- Use resource requests and limits
- Make resources configurable
- Set reasonable defaults
-
Security:
- Enable security contexts
- Use non-root users
- Set read-only root filesystem
-
Configuration:
- Use ConfigMaps for configuration
- Use Secrets for sensitive data
- Support external secrets
-
Template Tests:
templates/tests/test-connection.yaml: apiVersion: v1 kind: Pod metadata: name: "{{ include "chart.fullname" . }}-test" annotations: "helm.sh/hook": test
-
CI Tests:
- Must pass
helm lint
- Must pass
helm test
- Must pass template validation
- Must pass
-
README.md:
- Description of the chart
- Prerequisites
- Installation instructions
- Configuration options
- Examples
-
NOTES.txt:
- Post-installation instructions
- Access information
- Next steps
-
Chart Version:
- MAJOR: Incompatible API changes
- MINOR: Functionality in backward compatible manner
- PATCH: Bug fixes
-
App Version:
- Track the version of the contained application
- Document version compatibility
-
Pull Requests:
- Update documentation
- Add/update tests
- Update CHANGELOG.md
-
Review Process:
- Code review required
- Test results required
- Documentation review required