Skip to content

Chartgen is a dumb simple Helm Chart generator from manifest URLs

License

Notifications You must be signed in to change notification settings

anisimovdk/chartgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

chartgen

Chartgen is a dumb simple Helm Chart generator from manifest URLs

Features

  • CRDs auto-detect
  • helm lables, annotation auto-injection
  • namespace resource auto-remover
  • helmfile ready to use

Requirements

  • curl for downloading manifests
  • yq for patching manifests
  • helm for linting output helm chart
  • tree for listing output helm chart files

Feel free to modify.

Usage

./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.

Usage with helmfile

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

Thanks

To @mumoshu for helmify-kustomize and ability to use it with helmfile Helmfile-hooks

About

Chartgen is a dumb simple Helm Chart generator from manifest URLs

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages