Helm templates without text templating
Helm renders Go templates over YAML as text, so indentation is managed with nindent and quoting with quote. A NOVA template works on values: parameters are typed, there is no text to indent, and every render terminates.
Helm: templating text spec:
replicas: {{ .Values.replicas }}
template:
spec:
containers:
{{- toYaml .Values.containers | nindent 8 }}
{{- if .Values.metrics }}
- name: metrics
image: ghcr.io/example/metrics:v1
{{- end }}NOVA: templating values @template
@param replicas: u16 @range(1..50) = 2
@param containers: list<Container>
@param metrics: bool = false
spec:
replicas: $replicas
template:
spec:
containers:
...$containers
@if $metrics:
- name: metrics
image: ghcr.io/example/metrics:v1Templates are a separate kind of document. They render to a plain value before anything else reads it. Templates, spec §9.1
What changes
| Topic | Helm | NOVA | Spec |
|---|---|---|---|
| What is templated | YAML text | Values; indentation and escaping cannot go wrong | §9.1 |
| Parameters | values.yaml, checked if you add values.schema.json | @param with a type, a range and a default | §9.4 |
| Conditions | Truthiness: "", 0 and empty lists are false | A condition must be a bool; $owner != null, not $owner | §9.3 |
| Termination | Named templates can include themselves | No recursion, no user functions, and an output budget | §9.5 |
| Functions | Sprig: strings, math, crypto, lookups | References, interpolation, spreads, @if and @for; nothing else | §9.3 |
| Overrides | --set, untyped | --set, resolved against the parameter’s type | §9.4 |
Migrating
There is no Helm converter: port a chart’s templates by hand, one file at a time. Render to YAML for anything that expects it.
nvf render deployment.tpl.nova --schema k8s.novs \
--set 'containers=[{name: api, image: "ghcr.io/example/api:v5"}]' \
--set metrics=true --to yaml | kubectl apply -f -A bad value never reaches the template $ nvf render deployment.tpl.nova --schema k8s.novs --set replicas=80 …
× deployment.tpl.nova: parameter "replicas" does not match
`u16 @range(1..50)`: .: 80 is outside @range(1..50)Container comes from the schema passed with --schema, which also validates the rendered document. Evaluation, spec §9.4
When to stay with Helm
- You use Helm for releases: chart repositories, upgrades, rollbacks and hooks. NOVA only replaces the templating, not the release management.
- Your templates compute: string functions, arithmetic or cluster lookups. NOVA templates have none of these, on purpose.
- You need a format that is stable today. NOVA is a 0.1 draft.
Questions
Can NOVA produce Kubernetes YAML?
Yes. nvf render … --to yaml writes YAML 1.2 and quotes every string that a YAML reader could take for another type.
Can a template blow up in size?
No. Renderers enforce an output budget, 10^6 value nodes by default, which stops "billion laughs" constructions. Imports are limited in depth and may not form cycles.
Can a template read files or the network?
Only through @import, which the host resolves. The reference loader accepts relative paths below the template’s directory and rejects URLs and ...