Skip to content

This tool allows you to validate the format of your Helm values using a JSONSchema with the Helm pre-install & pre-upgrade hooks. πŸ‘Œ (for helm hook exemple)

Notifications You must be signed in to change notification settings

Franckrst/helm-values-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‘Œ Helm Values Validator (for hook exemple)

Helm values format validation tool

This tool allows you to validate the format of your Helm values using a JSONSchema with the Helm pre-install & `pre-upgrade hooks. Like helm Schema Files

helm-3.14.0 jsonschema-1.4.2 distroless~60mo linux/amd64,linux/arm64,linux/arm/v7

French Readme - English Readme

Features

  • Helm values format validation
  • Display error messages in case of problems
  • Manual execution possible

Terminal demo


πŸš€ Installation

  1. Copy the example/templates/tests/helm-values-validator.yaml file to your Helm stack.
  2. Add your schema.json to the root of your Helm chart (same level as the values.yaml).
  3. Install the Helm chart with the helm install command.
  4. (Optional) Convert your values.yaml file to JSONSchema on jsonformater.org

πŸ“ Logs

To see the validation error messages, you can use the following commands:

# Logs
kubectl logs release-name-helm-values-validator

# Error messages
kubectl get pod release-name-helm-values-validator -o go-template="{{range .status.containerStatuses}}{{.state.terminated.message}}{{end}}"

πŸ§‘β€πŸ”§ Manual execution

If you want to run the validation without installing Helm, you can run the container with the files and variables as in the following command:

docker run -it -v $(pwd)/values.json:/values.json -v $(pwd)/schema.json:/schema.json -e SCHEMA_FILE=/schema.json -e VALUES_FILE=/values.json franckrst/helm-values-validator:0.0.0-alpha

πŸ“ Architecture

A simple Helm pre-install and pre-upgrade hook that deploys:

  • A ConfigMap containing the schema.json file and a values.json file that contains the .Values variable.
  • A Pod that launches the validation container in which the ConfigMap is mounted.

License

MIT

Thx

About

This tool allows you to validate the format of your Helm values using a JSONSchema with the Helm pre-install & pre-upgrade hooks. πŸ‘Œ (for helm hook exemple)

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published