Verify that all values for a kubernetes helm chart have been used

Viewed 1287

I'd like to check that my kubernetes helm chart does not define unused values in values.yaml. This should include any subcharts such that if you've defined subchart.foo.bar: ??? in the top-level values.yaml that key is definitely used in the subchart, or possibly as a short-cut mentioned in the subchart/values.yaml.

This is needed to prevent us from shipping bogus "documentation" in the values.yaml, for example if a key in a subchart has been changed or removed.

Ideally there would also be some possibility to report on which subchart values have not been overridden in the top-level chart, though this is less concerning.

Are there any existing tools that can help with this?

2 Answers

Since the Helm v3 release you can now define a schema for your values. On commands like helm install your provided values are automatically validated against the schema.

Please see the official documentation: https://helm.sh/docs/topics/charts/#schema-files

Schema validation works for subcharts too, this is also mentioned in the documentation on the link above.

Related