Troubleshooting
On this page
helm-schema is alpha. It works for many charts, but Helm templates have many edge cases, such as
dynamic keys, helpers that build values at render time, and behavior that only shows when Helm runs.
Treat a generated schema as a strong start to review, and expect some charts to need an
override.
A value is typed loosely or not at all#
Look at standard error first: helm-schema says why it could not type a resource, as a
diagnostic. Then, by cause:
MissingSchemafor a custom resource: add a CRD catalog mirror that has it, or put its schema in a local override.MissingSchemafor an API that recent Kubernetes removed: add--k8s-version-fallback auto.- The
apiVersioncould not be pinned: try--api-version-guess. - Anything else: tighten the value with an override schema.
A guard does not make a value a boolean#
{{ if .Values.x }} accepts more than true: Helm treats false, 0, "", an empty list and an
empty map as false, and everything else as true. The schema says exactly that, as an anyOf of the
non-empty forms. A value only becomes a boolean when something types it as one, such as a boolean
Kubernetes field. Template analysis shows an
example.
An integer is an anyOf of an integer and a string#
Helm renders a quoted number where a number is expected: replicas: "2" renders the same as
replicas: 2. The string member, with a numeric pattern, accepts that form, so the schema does
not reject values Helm renders.
A value is required#
The schema requires a value that the templates always render, where a missing value would fail the
render or produce an invalid resource. Helm checks the values merged with the chart’s defaults, so a
key the chart’s values.yaml sets is only missing when a user removes it by setting it to null.
--infer-required adds more:
Required fields says which.
A values file passes, and helm template -f still fails#
One schema has to serve every way values reach Helm, and they differ. --set replicas=3 gives a
template an integer, while the same number in a values file arrives as a float, and some templates,
such as a range over a count, accept one and fail on the other. The schema accepts every value
some way renders, so a number that only works through --set passes validation.
helm-schema warns about such a value with InputChannelNumericRangeAmbiguity. Run CI values
files through a real helm template -f as well.
Helm refuses the schema as too large#
Helm refuses any chart file over 5 MiB. By default helm-schema switches to compact JSON with
short definition names when the readable schema would be larger, and says so on standard error.
When even that is too large, or validating it is slow:
- The
leanprofile: drops document-level conditions; see Configuration. --strip-descriptions: drops the Kubernetes descriptions.helm-schema lintandhelm-schema template: run Helm on a copy of the chart with a shortened schema, so you can keep the readable one; see Output.
Reporting a wrong inference#
Open an issue with the chart, or a small chart that shows the problem, the schema you got, and what you expected.