helmtk is a toolkit for Helm chart maintainers.
Helm charts struggle with indentation. Significant whitespace in YAML combined with a text-based template language leads to charts which are buggy and difficult to maintain.
{{- and | nindent| quote| toYaml. (and did you know about $?)yes as a boolean{{- define "namespace" -}}
{{- if .Values.namespaceOverride -}}
{{- .Values.namespaceOverride -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
{{- end -}}
metadata:
labels:
{{- with .Chart.AppVersion }}
app.kubernetes.io/version: {{ . | quote }}
{{- end }}
{{- include "foo.selectorLabels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
helmtk provides a structured template language, allowing templating without significant whitespace.
"ports": [
{
"containerPort": 8000
"name": "http"
}
if Values.debug do
{ "containerPort": 5005, "name": "debug" }
end
for name, port in Values.tcpPorts do
{ "containerPort": port, "name": name }
end
]
The helmtk compile command compiles these structured templates into Helm chart templates.
Helm chart maintainers get the benefits of helmtk without disrupting users of the Helm charts.
"ports": [
{
"containerPort": 8000,
"name": "http",
},
{{- if .Values.debug -}}
{
"containerPort": 5005,
"name": "debug",
},
{{- end -}}
{{- range $name, $port := .Values.tcpPorts -}}
{
"containerPort": {{ $port | toJson }},
"name": {{ $name | toJson }},
},
{{- end }}
]
helmtk provides a test runner, with tests written in Javascript.
// helmtk/tests/example.js
test("test debug port", t => {
t.Values.debug = true
let res = t.render()[0]
t.eq(res.ports[1].name, "debug")
})
> helmtk test .
example.js
✓ test debug port
The decompiler converts existing charts into helmtk tempates automatically, and writes a comprehensive test suite at the same time.
The helmtk VS Code extension provides:

Free for personal, non-commercial use.
Includes all capabilities, except the decompiler.
$25 for the first 100,000 tokens.
$5 for additional 100,000 tokens.
The decompiler is currently in a limited beta. Join the waitlist:
$50 per year
Commercial subscriptions are currently in limited beta. Join the waitlist:
go install github.com/helmtk/helmtk@latest
brew install helmtk/tap/helmtk
Download pre-built binaries from the latest release.