Customize Helm charts without modifying them – using Grafana Tanka
grafana.com
grafana.com
I've long been looking for something that lets me keep my static yaml for my own projects, and helm charts with occasional small tweaks, and Tanka seems to do it!
local parseYaml = std.native('parseYaml');
local k = (import 'ksonnet-util/kausal.libsonnet');
local helm = (import 'helm-util/helm.libsonnet').new(std.thisFile);
{
aws_secret: parseYaml(importstr 'k8s/aws-secret.yaml'),
// etc...
traefik: helm.template('traefik', '../../charts/traefik', {
values: parseYaml(importstr 'values/traefik.yaml')[0],
}) + {
// traefik requires a /plugins-storage tmpdir
deployment_traefik+: k.util.emptyVolumeMount('plugins-storage', '/plugins-storage'),
},
}
If I had one request, it'd be to be able to run an arbitrary command for manifest generation: jsonnet seems quite capable, but every once in a while you're in a rush and just can't figure out how to do something - that's when being able to generate the manifest dynamically via bash/python/whatever is quite useful.