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
French Readme - English Readme
Features
- Helm values format validation
- Display error messages in case of problems
- Manual execution possible
- Copy the
example/templates/tests/helm-values-validator.yaml
file to your Helm stack. - Add your
schema.json
to the root of your Helm chart (same level as the values.yaml). - Install the Helm chart with the
helm install
command. - (Optional) Convert your
values.yaml
file toJSONSchema
on jsonformater.org
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}}"
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
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.
MIT