Helm template and lint
Render without installing
Helm template evaluates chart templates locally under its default client-only behavior and prints resource YAML. It is useful for reviewing names, labels, images, ports, resource requests and other configuration before any deployment. Helm lint examines chart problems and conventions. Neither proves admission or readiness. This chart has no hooks, lookup calls, remote dependencies or real secrets; use a reviewed Helm binary and local files only.
helm lint ./catalog -f dev.yamlhelm template demo ./catalog --namespace helm-study -f dev.yamlObserve a missing input
The template requires a nonempty message. The default values intentionally provide an empty string, so rendering without an override is expected to fail. The exact diagnostic depends on the Helm version. Supplying dev.yaml provides a valid message. Some lint modes do not report required-value failures the same way as rendering; always run the actual render with each supported values profile.
helm template demo ./catalog --namespace helm-study# Expected failure; supply -f dev.yaml for a successful prediction.Templates and rendered YAML differ
The following template fragment contains a Go template expression, so it is not raw Kubernetes YAML. The quote function makes the result a string; the required function checks presence of a nonempty input for this fixture. A successful render should produce an environment entry named MESSAGE containing Development catalog. Do not feed unrendered templates directly to kubectl.
- name: MESSAGE value: {{ required "message must be supplied" .Values.message | quote }}Review relationships rather than formatting
Check that the Deployment selector matches its Pod labels and that the Service selects those same Pods for the same release. The Service accepts traffic on port 80 and targets 8080 inside the Pod. That does not prove a process listens on 8080. The image is intentionally non-deployable, so no successful workload response is expected. Check each release name and environment separately, not just whether the output can be parsed.
selector: app: catalog instance: demoports:- port: 80 targetPort: 8080Validation levels are separate
Local lint and render are first gates. Parse rendered YAML, validate resource schemas against the intended API versions, and check policies and cross-resource relationships. Server-side dry runs require an approved cluster and may invoke admission, but do not prove a workload becomes ready. Finally run controlled deployment and application tests with real approved images, then inspect cleanup. Do not publish real rendered Secrets or use unreviewed plugins, chart hooks or post-renderers.
local lint → render → schema/policy review → authorized admission check → runtime testsPractice
Use the README and values-cases.json to predict the valid and invalid renders. Run the provided Python checker if PyYAML is available; it checks only flat input precedence and source relationships, not Helm behavior. With a reviewed Helm installation, compare actual render output to the predictions. Explain one failure each gate can and cannot detect.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Helm template and lint — knowledge check
Apply the lesson concepts to the original offline chart and release scenarios.
What is expected if the message is omitted in this chart?
Which tool evaluates the Go template expressions locally?
What does a successful lint establish?
Which relationship should be checked for Service routing?
What does the supplied Python checker prove?