Chartgen is a dumb simple Helm Chart generator from manifest URLs
- CRDs auto-detect
- helm lables, annotation auto-injection
- namespace resource auto-remover
- helmfile ready to use
curl
for downloading manifestsyq
for patching manifestshelm
for linting output helm charttree
for listing output helm chart files
Feel free to modify.
./chartgen <cmd> <output_helmchart_dir> <chart_release_namespace> [url1] [url2] [urlN]
./chartgen.sh build chartgen/cdi kubevirt-cdi \
"https://github.com/kubevirt/containerized-data-importer/releases/download/v1.56.0/cdi-operator.yaml" \
"https://github.com/kubevirt/containerized-data-importer/releases/download/v1.56.0/cdi-cr.yaml"
You must specify <chart_release_namespace>
for correct helm labels and annotation injection.
Put chartgen.sh
near helmfile.yaml
and run helmfile apply
, profit!
# helmfile.yaml
releases:
- name: cdi
chart: chartgen/cdi
namespace: cdi
disableValidation: true
createNamespace: true
hooks:
- events:
- prepare
- cleanup
command: ./chartgen.sh
args:
- '{{`{{if eq .Event.Name "prepare"}}build{{else}}clean{{end}}`}}'
- '{{`{{.Release.Chart}}`}}'
- '{{`{{.Release.Namespace}}`}}'
- https://github.com/kubevirt/containerized-data-importer/releases/download/v1.56.0/cdi-operator.yaml
- https://github.com/kubevirt/containerized-data-importer/releases/download/v1.56.0/cdi-cr.yaml
To @mumoshu for helmify-kustomize and ability to use it with helmfile Helmfile-hooks