Working with Helm Starters
1. Understanding Helm Starters
Helm Starters are pre-defined project templates that help users quickly bootstrap new Helm charts with a consistent structure and common configurations.
| Property | Description | Example |
|---|---|---|
| starter.name | Name of the starter template | nodejs-app |
| starter.description | Short description of the starter | A Helm chart for Node.js applications |
| starter.tags | Tags to categorize the starter | ["application", "nodejs"] |
| starter.version | Version of the starter template | v1.0.0 |
Note: Helm Starters are defined in the
starter.yaml file within a starter directory.
2. Creating Starter Charts
| Field | Description | Example |
|---|---|---|
| name | Name of the starter chart | my-app-starter |
| version | Version of the starter chart | 1.0.0 |
| description | Short description of the starter chart | A starter for a basic web application |
| home | URL to the project homepage | https://example.com/my-app-starter |
| maintainers | List of maintainers with name and email | |
Example: Creating a basic starter chart structure
helm create my-app-starter
cd my-app-starter
rm -rf templates/*
rm values.yaml
rm Chart.yaml
Example: Creating a minimal Chart.yaml for starter
apiVersion: v2
name: my-app-starter
version: 1.0.0
description: A starter for a basic web application
type: application
Note: Starter charts are typically created without templates or values files to avoid conflicts with user-defined configurations.
3. Using Starter Templates
| Property | Description | Example |
|---|---|---|
| starter.name | Name of the starter template | nodejs-app |
| starter.description | Description of the starter template | A Helm chart for a Node.js application |
| starter.version | Version of the starter template | v1.0.0 |
| starter.home | URL to the project homepage | https://example.com/nodejs-app |
| starter.maintainers | List of maintainers | [{name: "John Doe", email: "john@example.com"}] |
Example: Creating a Starter Template
name: nodejs-app
description: A Helm chart for a Node.js application
version: v1.0.0
home: https://example.com/nodejs-app
maintainers:
- name: John Doe
email: john@example.com
Note: Starter templates are used to bootstrap new Helm charts with a predefined structure and configuration.
Warning: Ensure that the starter template includes all necessary files and configurations to properly initialize a new Helm chart.
4. Organizing Starters Directory
Example: Directory Structure
my-helm-starters/
├── starter-1/
│ ├── templates/
│ │ └── deployment.yaml
│ └── Chart.yaml
├── starter-2/
│ ├── templates/
│ │ └── service.yaml
│ └── Chart.yaml
└── starters.yaml
| Directory | Description | Notes |
|---|---|---|
| starter-1/ | First Helm starter template | Contains a basic deployment |
| starter-2/ | Second Helm starter template | Contains a basic service |
| starters.yaml | Configuration file for starters | Defines available starters |
Note: The
starters.yaml file is optional and can be auto-generated.5. Customizing Starter Templates
| Property | Description | Example |
|---|---|---|
| starter.name | Name of the starter template | my-app-starter |
| starter.description | Description of the starter template | A Helm chart starter for a basic web application |
| starter.version | Version of the starter template | 1.0.0 |
| starter.home | URL to the project homepage | https://example.com/my-app-starter |
| starter.sources | List of source URLs for the starter | ["https://github.com/example/my-app-starter"] |
| starter.maintainers | List of maintainers with name and email | [{name: "John Doe", email: "john@example.com"}] |
Example: Creating a Custom Starter Template
name: my-app-starter
description: A Helm chart starter for a basic web application
version: 1.0.0
home: https://example.com/my-app-starter
sources:
- https://github.com/example/my-app-starter
maintainers:
- name: John Doe
email: john@example.com
Note: The
starter directory must be structured according to the Helm starter template conventions.
Warning: Ensure that all paths in the starter template are relative to the root of the starter directory.
6. Sharing Starter Charts
Starter charts in Helm are designed to be shared across teams and projects. They provide a standardized way to bootstrap new chart projects with common structures, configurations, or templates.
| Aspect | Description | Notes |
|---|---|---|
| Repository Type | Can be local or remote (e.g., GitHub, GitLab) | Remote repositories are preferred for sharing |
| Sharing Method | Using Git repositories or Helm repositories | Git is more common for starters due to their structure |
| Versioning | Use semantic versioning (e.g., v1.0.0) | Version tags help in tracking changes and updates |
Example: Creating a Shared Starter Chart Repository
mkdir my-starter-chart
cd my-starter-chart
git init
# Add starter chart files here (e.g., templates, values.yaml)
git add .
git commit -m "Initial commit of starter chart"
git remote add origin https://github.com/myorg/my-starter-chart.git
git push -u origin main
Example: Using a Shared Starter Chart
helm create --starter my-starter-chart my-new-app
# This will use the starter chart from the repository
Note: Ensure that the starter chart repository is accessible to all users who intend to use it. Permissions and access control should be configured accordingly.
Best Practices for Sharing
- Use descriptive names for starter charts to make them easy to identify.
- Document the purpose and usage of each starter chart in a README file.
- Keep starter charts updated with the latest best practices and configurations.
- Use version tags to manage different versions of the same starter chart.
7. Implementing Organization Standards
Example: Helm Starter Template Structure
starter-template/
├── Chart.yaml
├── values.yaml
├── templates/
│ ├── deployment.yaml
│ └── service.yaml
└── README.md
| Component | Description | Usage |
|---|---|---|
| Chart.yaml | Metadata about the chart | Defines name, version, appVersion |
| values.yaml | Default values for templates | Used to customize chart behavior |
| templates/ | Template files for Kubernetes resources | Generated from templates during installation |
| README.md | Documentation for the starter | Guides users on usage and customization |
Note: Helm starters are templates that help standardize chart creation across an organization.
Comparison: Helm Starters vs Chart Repositories
- Helm Starters: Predefined templates for rapid chart creation
- Chart Repositories: Centralized storage for published charts
Workflow: Creating a Helm Starter
- Create directory structure for starter
- Define base chart metadata in
Chart.yaml - Set default values in
values.yaml - Add Kubernetes templates in
templates/ - Write documentation in
README.md - Install starter using
helm create --starter
8. Using Starter Variables
| Variable | Description | Example Value |
|---|---|---|
| {{.Chart.Name}} | Name of the chart | myapp |
| {{.Chart.Version}} | Version of the chart | 1.2.3 |
| {{.Chart.AppVersion}} | Application version | 2.0.0 |
| {{.Chart.Description}} | Chart description | A Helm chart for myapp |
| {{.Chart.Home}} | Home page URL | https://example.com/myapp |
| {{.Chart.Sources}} | Source URLs | [https://github.com/example/myapp] |
| {{.Chart.Maintainers}} | Maintainer information | [{name: John, email: john@example.com}] |
| {{.Chart.Icon}} | Icon URL | https://example.com/icon.png |
| {{.Chart.Keywords}} | Keywords for chart | [app, helm] |
| {{.Chart.KubeVersion}} | Kubernetes version constraint | ">=1.19.0-0" |
Example: Using Variables in Templates
apiVersion: v1
kind: Service
metadata:
name: {{ .Chart.Name }}-service
spec:
selector:
app: {{ .Chart.Name }}
ports:
- port: 80
targetPort: 8080
Note: Starter variables are replaced during chart creation using
helm create or helm init. They are not dynamically evaluated at runtime.
9. Testing Starter Charts
Example: Basic Test Structure
apiVersion: v1
kind: Pod
metadata:
name: test-pod
spec:
containers:
- name: test-container
image: nginx:latest
ports:
- containerPort: 80
| Test Type | Description | Command | Notes |
|---|---|---|---|
| Unit Tests | Validate individual chart components | helm template . | kubeval |
Requires kubeval installed |
| Integration Tests | Test chart deployment and functionality | helm install --dry-run . |
Simulates deployment without actual creation |
| E2E Tests | End-to-end validation of deployed resources | kubectl get pods |
Verifies actual resource creation |
Note: Use
helm template to render templates locally before deployment.
Warning: Ensure test environments are isolated to prevent conflicts.
Testing Best Practices
- Validate chart templates with
kubeval - Use
helm install --dry-runfor deployment simulation - Run E2E tests in isolated namespaces
- Automate testing in CI pipelines
10. Maintaining Starter Charts
| Aspect | Description | Notes |
|---|---|---|
| starter chart structure | |
Standard Helm chart layout with templates and values |
| Chart.yaml fields | |
Must include type: application for starters |
| starter chart naming | myorg/my-starter |
Use namespace-like naming to avoid conflicts |
Example: Creating a starter chart
helm create my-starter
cd my-starter
# Modify templates and values as needed
helm package .
Note: Starter charts must be packaged and published to a Helm repository or local directory for use.