Skip to content

arttor/helmify

Repository files navigation

Helmify

CI GitHub go.mod Go version GitHub GitHub release (latest by date) Go Report Card GoDoc GitHub total downloads

CLI that creates Helm charts from kubernetes manifests.

Helmify reads a list of supported k8s objects from stdin and converts it to a helm chart. Designed to generate charts for k8s operators but not limited to. See examples of charts generated by helmify.

Supports Helm >=v3.6.0

Submit issue if some features missing for your use-case.

Usage

  1. As pipe:

    cat my-app.yaml | helmify mychart

    Will create 'mychart' directory with Helm chart from yaml file with k8s objects.

    awk 'FNR==1 && NR!=1  {print "---"}{print}' /<my_directory>/*.yaml | helmify mychart

    Will create 'mychart' directory with Helm chart from all yaml files in <my_directory> directory.

  2. From filesystem:

    helmify -f /my_directory/my-app.yaml mychart

    Will create 'mychart' directory with Helm chart from my_directory/my-app.yaml.

    helmify -f /my_directory mychart

    Will create 'mychart' directory with Helm chart from all yaml files in <my_directory> directory.

    helmify -f /my_directory -r mychart

    Will create 'mychart' directory with Helm chart from all yaml files in <my_directory> directory recursively.

    helmify -f ./first_dir -f ./second_dir/my_deployment.yaml -f ./third_dir  mychart

    Will create 'mychart' directory with Helm chart from multiple directories and files.

  3. From kustomize output:

    kustomize build <kustomize_dir> | helmify mychart

    Will create 'mychart' directory with Helm chart from kustomize output.

Integrate to your Operator-SDK/Kubebuilder project

  1. Open Makefile in your operator project generated by Operator-SDK or Kubebuilder.
  2. Add these lines to Makefile:
  • With operator-sdk version < v1.23.0
    HELMIFY = $(shell pwd)/bin/helmify
    helmify:
    	$(call go-get-tool,$(HELMIFY),github.com/arttor/helmify/cmd/helmify@v0.3.7)
    
    helm: manifests kustomize helmify
    	$(KUSTOMIZE) build config/default | $(HELMIFY)
  • With operator-sdk version >= v1.23.0