ChartScan is a CLI tool for scanning and analyzing Helm charts. It provides insights into Helm chart configurations, values, and rendering issues, allowing developers to efficiently debug and validate Helm charts before deployment.
- Scans directories for Helm charts.
- Supports multiple values files for rendering charts.
- Configurable output formats: pretty, JSON, JUnit, or YAML.
- Supports configuration through YAML-based config files.
For convenience, precompiled binaries are available for the latest releases of ChartScan. These binaries are built for multiple architectures and can be directly downloaded from the Releases page on GitHub.
To download the latest release:
-
Go to the ChartScan Releases Page.
-
Download the appropriate binary for your system:
- Linux amd64:
chartscan-amd64
- Linux arm64:
chartscan-arm64
- Linux 386:
chartscan-386
- Linux amd64:
-
(Optional) Move the binary to a directory in your system's
PATH
:mv chartscan-[architecture] /usr/local/bin/chartscan
Ensure the following dependencies are installed:
- Helm: Install Helm
The scan
command is used to analyze Helm charts for potential issues:
chartscan scan [chart-path]
-f, --values
: Specify values files to use for rendering.-o, --format
: Set the output format (pretty, json, yaml, junit). Default ispretty
.-c, --config
: Provide a configuration file (YAML format) to override CLI flags.-e, --environment
: (Optional) Specify the environment to use (e.g., test, staging, production). This will load preconfigured values files for the specified environment in chartscan.yaml.
The template
command is used to render Helm charts with helm template:
chartscan template [chart-path]
-f, --values
: Specify values files to use for rendering.-o, --format
: Specify an output file to write the rendered chart (optional).-c, --config
: Provide a configuration file (YAML format) to override CLI flags.-e, --environment
: (Optional) Specify the environment to use (e.g., test, staging, production). This will load preconfigured values files for the specified environment in chartscan.yaml.
The version
command displays the current version of ChartScan:
chartscan version
chartscan scan ./charts -f values.yaml -o json
chartscan scan -c config.yaml
chartPath: ./charts
valuesFiles:
- values.yaml
format: yaml
environments:
test:
valuesFiles:
- values-test.yaml
- values-2-test.yaml
staging:
valuesFiles:
- values-staging.yaml
production:
valuesFiles:
- values-production.yaml
When you run ChartScan inside a Git repository, the tool will automatically search for and load a configuration file located in the root directory of the repository. This behavior eliminates the need to manually specify the config file with the -c option if you already have one in your repository.
How It Works ChartScan looks for a file named chartscan.yaml in the root directory of the repository. If the config file is found, ChartScan will automatically load it and use its settings, including chart paths, values files, output format, and more.
This behavior simplifies configuration management, especially for projects with shared settings across team members. Example: Automatic Config Loading For example, if your Git repository has the following directory structure:
my-repo/
├── chartscan.yaml
├── charts/
│ └── my-chart/
├── values.yaml
└── README.md
When you run (inside a git repo with a chartscan.yaml in the root directory):
chartscan scan ./charts
ChartScan will automatically detect and use chartscan.yaml for its configuration.
- Pretty: Human-readable formatted output.
- JSON: Machine-readable JSON format.
- YAML: YAML-encoded output for further processing.
- JUnit: JUnit-compatible XML format for test reports.
-
Clone the repository.
-
Install dependencies:
go mod tidy
-
Run the tool:
go run main.go [command] [options]
Run the test suite:
go test ./...
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch (
git checkout -b feature-name
). - Commit your changes (
git commit -m "Add feature"
). - Push to the branch (
git push origin feature-name
). - Open a pull request.