Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Helm Validator

A small shell utility for validating Helm charts in a directory across multiple environment-specific values files.

Overview

This utility helps you run helm lint and/or helm template for all Helm charts in a given directory. It is designed for local validation of charts and values files before deployment.

It supports:

  • scanning every subdirectory for Chart.yaml
  • validating environment-specific values.<env>.yaml files
  • running one or both modes: template, lint, or both

Prerequisites

Before using this utility, make sure you have:

  • macOS, Linux, or another POSIX-compatible shell environment
  • bash or zsh
  • Helm installed and available on your PATH

To verify Helm is installed:

helm version

Install the utility

You can install the utility using the included installer script.

Step 1: Clone the repository

git clone https://github.com/<your-user>/helm-validator.git
cd helm-validator

Step 2: Run the installer

./install.sh

This script will:

  • copy validate-helm.sh to ~/global-scripts/validate-helm.sh
  • make the script executable
  • add an alias to your shell config if needed

After install, reload your shell:

source ~/.zshrc   # or ~/.bashrc or ~/.bash_profile or ~/.profile depending on your shell

Then run:

validate-helm

Short-hand usage without installing

You can run the validator directly from the repository without installing it.

cd helm-validator
./validate-helm.sh

You can also run the script from anywhere if you provide the repository path:

/path/to/helm-validator/validate-helm.sh

Usage

validate-helm [options] [directory]

When using the script directly:

./validate-helm.sh [options] [directory]

Options

  • -e, --envs : comma-separated list of environments to validate
    • default: dev,qa,uat,prd
  • -m, --mode : template, lint, or both
    • default: template
  • -h, --help : show help information

Directory

  • Optional directory to validate
  • Default: current working directory

Examples

Validate templates only for all default envs

validate-helm

Validate both lint and template for all default envs

validate-helm -m both

Validate only dev and qa values files

validate-helm -e dev,qa

Validate a different directory

validate-helm ../charts

Direct script execution without install

./validate-helm.sh -m both -e dev,qa ../my-charts

What the script does

For each chart directory in the target path, the script:

  1. detects whether Chart.yaml exists
  2. skips directories without a chart
  3. checks for values.<env>.yaml files for each requested environment
  4. runs the selected Helm command(s):
    • helm template for rendering templates
    • helm lint for chart linting

If any check fails, the script reports the error output and exits with a non-zero status.

Output behavior

  • indicates a passed validation
  • indicates a failed validation
  • ⚠️ indicates a missing values file for a specific environment
  • The script prints a summary at the end

Troubleshooting

  • If the script cannot access the directory, verify the path and permissions.
  • If helm is not found, install Helm and ensure it is on your PATH.
  • If a values file is missing, add values.<env>.yaml to the chart directory or adjust the --envs list.

Notes

  • The installer writes to ~/global-scripts and adds an alias to your shell config only if needed.
  • If your shell is not bash or zsh, the installer falls back to ~/.bash_profile or ~/.profile.
  • You can customize the target directory and modes without modifying the script.

License

This repository is licensed under the MIT License. See LICENSE for details.

About

This is a utility that allows you to validate a series of helm charts using either template or lint.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages