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 templates/deployment.yaml
spec:
  replicas: {{ .Values.replicas }}
  template:
    spec:
      containers:
        {{- toYaml .Values.containers | nindent 8 }}
        {{- if .Values.metrics }}
        - name: metrics
          image: ghcr.io/example/metrics:v1
        {{- end }}
any type
count the spaces
truthy?
NOVA: templating values deployment.tpl.nova
@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:v1
checked range
typed list
must be a bool
no indentation

Templates are a separate kind of document. They render to a plain value before anything else reads it. Templates, spec §9.1

What changes

TopicHelmNOVASpec
What is templatedYAML textValues; indentation and escaping cannot go wrong§9.1
Parametersvalues.yaml, checked if you add values.schema.json@param with a type, a range and a default§9.4
ConditionsTruthiness: "", 0 and empty lists are falseA condition must be a bool; $owner != null, not $owner§9.3
TerminationNamed templates can include themselvesNo recursion, no user functions, and an output budget§9.5
FunctionsSprig: strings, math, crypto, lookupsReferences, 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 ...