✦ For everyone, free.

Practical knowledge for real and everyday life

Home

Chart Creation and Starters

Helm's Chart Creation and Starters simplify deploying apps with structured configs, enabling scalable containerized infrastructure.

Chart Creation and Starters refers to the process and tools involved in building Helm charts from scratch or by using predefined templates known as starters. Helm charts are packages that define, install, and manage Kubernetes applications. Creating charts and using starters streamline application deployment, configuration, and lifecycle management on Kubernetes clusters.


Chart Creation Fundamentals

Chart Structure

A Helm chart follows a standardized directory layout, which typically includes:

  • Chart.yaml: The main metadata file describing the chart, such as name, version, description, and dependencies.
  • values.yaml: Default configuration values for the chart, allowing users to customize deployments.
  • templates/: A directory containing Kubernetes manifest templates written in Go templating language, which generate resource definitions dynamically based on values.
  • charts/: A directory to hold dependent charts that are packaged along with the main chart.
  • README.md (optional): Documentation specific to the chart.
  • LICENSE (optional): Licensing information.

The structure ensures consistency and allows Helm to package and deploy applications effectively.

Creating a New Chart

To create a new Helm chart manually, the following steps are typically undertaken:

  1. Initialize the Chart Directory: Create a folder with the chart name.
  2. Create Chart.yaml: Define chart metadata.
  3. Create values.yaml: Specify default configuration.
  4. Create Template Files: Write Kubernetes manifests in the templates/ directory using Helm’s templating syntax.
  5. Package and Test: Use Helm CLI commands such as helm package and helm install --dry-run to validate the chart.

Alternatively, Helm CLI provides a command to bootstrap a new chart:

helm create mychart

This command generates a scaffolded chart directory with example templates and configuration files that serve as a starting point for customization.

Template Syntax and Functions

Helm templates use the Go template language extended with Helm-specific functions and pipelines. These features allow dynamic behavior such as:

  • Conditionals (if, else, with)
  • Loops (range)
  • Value interpolation ({{ .Values.key }})
  • Functions for string manipulation, data conversion, and Kubernetes-specific lookups
  • Template inclusion and partials for modularity

This templating system enables charts to be flexible and reusable across different environments.


Starters in Chart Development

Purpose of Starters

Starters are predefined chart templates or skeletons that serve as blueprints for new charts. They simplify the initial creation process by providing a base set of files and structures tailored for specific use cases or organizational standards.

By using starters, developers can adhere to best practices, maintain consistency across charts, and reduce repetitive setup work.

How Starters Are Used

Helm supports the use of starters by allowing users to specify a starter directory when creating a new chart:

helm create --starter mystarter mynewchart

The starter directory contains a ready-made chart scaffold with customized templates, values, and metadata. When invoked, Helm copies the starter contents to the new chart directory, from which developers can further customize.

Starters can be shared within teams or organizations to enforce policies or embed common configurations and conventions.

Customizing and Managing Starters

Organizations often create and maintain their own starter templates stored in version control systems or local directories. These starters may include:

  • Predefined resource templates with organizational labels and annotations
  • Default security contexts and resource limits
  • Commonly used service types or ingress configurations
  • Integration with CI/CD pipelines through annotations or hooks

Managing starters involves updating them as best practices evolve and ensuring compatibility with Helm versions and Kubernetes API changes.


Best Practices in Chart Creation and Starters

Maintain Clear and Descriptive Metadata

The Chart.yaml should accurately describe the chart purpose, versioning, and dependencies to facilitate easy discovery and management.

Leverage Values for Configuration

Expose as many configuration options as practical via values.yaml to increase chart flexibility and reduce duplication.

Keep Templates Modular and Reusable

Use named templates and partials to avoid repetition and simplify maintenance. This also aids in readability and debugging.

Validate Charts Thoroughly

Use Helm commands such as helm lint and helm template to check for template errors and render output before deployment.

Use Starters to Enforce Standards

Adopt or create starters to maintain consistency across charts, especially in large teams or organizations. Periodically review and update starters.

Document Clearly

Provide comprehensive README files and inline comments within templates to assist users and maintainers.


Tools and Commands for Chart Creation

CommandPurpose
helm create <chartname>Generates a new chart scaffold or starter
helm package <chartdir>Packages a chart directory into a .tgz
helm lint <chartdir>Checks chart for syntax and best practices
helm template <chartdir>Renders templates locally without deploying
helm install <release>Deploys the chart to Kubernetes cluster

These tools form the core workflow for chart development, testing, and deployment.


Chart Creation and Starters form the foundation for Helm-based Kubernetes application management by providing standardized, reusable templates and scaffolds that accelerate development, ensure consistency, and simplify configuration and deployment processes.