Helmify
Creates Helm chart from Kubernetes yaml
Install / Use
/learn @arttor/HelmifyREADME
Helmify
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
-
As pipe:
cat my-app.yaml | helmify mychartWill create 'mychart' directory with Helm chart from yaml file with k8s objects.
awk 'FNR==1 && NR!=1 {print "---"}{print}' /<my_directory>/*.yaml | helmify mychartWill create 'mychart' directory with Helm chart from all yaml files in
<my_directory>directory. -
From filesystem:
helmify -f /my_directory/my-app.yaml mychartWill create 'mychart' directory with Helm chart from
my_directory/my-app.yaml.helmify -f /my_directory mychartWill create 'mychart' directory with Helm chart from all yaml files in
<my_directory>directory.helmify -f /my_directory -r mychartWill 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 mychartWill create 'mychart' directory with Helm chart from multiple directories and files.
-
From kustomize output:
kustomize build <kustomize_dir> | helmify mychartWill create 'mychart' directory with Helm chart from kustomize output.
Integrate to your Operator-SDK/Kubebuilder project
- Open
Makefilein your operator project generated by Operator-SDK or Kubebuilder. - 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
HELMIFY ?= $(LOCALBIN)/helmify .PHONY: helmify helmify: $(HELMIFY) ## Download helmify locally if necessary. $(HELMIFY): $(LOCALBIN) test -s $(LOCALBIN)/helmify || GOBIN=$(LOCALBIN) go install github.com/arttor/helmify/cmd/helmify@latest helm: manifests kustomize helmify $(KUSTOMIZE) build config/default | $(HELMIFY)
- Run
make helmin project root. It will generate helm chart with name 'chart' in 'chart' directory.
Install
With Homebrew (for MacOS or Linux): brew install arttor/tap/helmify
Or download suitable for your system binary from the Releases page. Unpack the helmify binary and add it to your PATH and you are good to go!
Available options
Helmify takes a chart name for an argument. Usage:
helmify [flags] CHART_NAME - CHART_NAME is optional. Default is 'chart'. Can be a directory, e.g. 'deploy/charts/mychart'.
| flag | description | sample |
|---------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|
| -h -help | Prints help | helmify -h |
| -f | File source for k8s manifests (directory or file), multiple sources supported | helmify -f ./test_data |
| -r | Scan file directory recursively. Used only if -f provided | helmify -f ./test_data -r |
| -v | Enable verbose output. Prints WARN and INFO. | helmify -v |
| -vv | Enable very verbose output. Also prints DEBUG. | helmify -vv |
| -version | Print helmify version. | helmify -version |
| -crd-dir | Place crds in their own folder per Helm 3 docs. Caveat: CRDs templating is not supported by Helm. | helmify -crd-dir |
| -image-pull-secrets | Allows the user to use existing secrets as imagePullSecrets | helmify -image-pull-secrets |
| -original-name | Use the object's original name instead of adding the chart's release name as the common prefix. | helmify -original-name |
| -cert-manager-as-subchart | Allows the user to install cert-manager as a subchart | helmify -cert-manager-as-subchart |
| -cert-manager-version | Allows the user to specify cert-manager subchart version. Only useful with cert-manager-as-subchart. (default "v1.12.2") | helmify -cert-manager-version=v1.12.2 |
| -cert-manager-install-crd | Allows the user to install cert-manager CRD as part of the cert-manager subchart.(default "true") | helmify -cert-manager-install-crd |
| -preserve-ns | Allows users to use the object's original namespace instead of adding all the resources to a common namespace. (default "false") | helmify -preserve-ns |
| -add-webhook-option | Adds an option to enable/disable webhook installation | helmify -add-webhook-option|
| -optional-crds | Enable optional CRD installation through values. | helmify -optional-crds |
Status
Supported k8s resources:
- Deployment, DaemonSet, StatefulSet
- Job, CronJob
- Service, Ingress
- PersistentVolumeClaim
- RBAC (ServiceAccount, (cluster-)role, (cluster-)roleBinding)
- configs (ConfigMap, Secret)
- webhooks (cert, issuer, ValidatingWebhookConfiguration)
- custom resource definitions (CRD)
Known issues
- Helmify will not overwrite
Chart.yamlfile if presented. Done on purpose. - Helmify will not delete existing template files, only overwrite.
- Helmify overwrites templates and values files on every run. This means that all your manual changes in helm template files will be lost on the next run.
- if switching between the using the
-crd-dirflag it is better to delete and regenerate the from scratch to ensure crds are not accidentally spliced/formatted into the same chart. Bear in mind you will want to update yourChart.yamlthereafter.
Develop
To support a new type of k8s object template:
- Implement
helmify.Processorinterface. Place implementation inpkg/processor. The package contains examples for most k8s objects. - Register your processor in the
pkg/app/app.go - Add relevant input sample to
test_data/kustomize.output.
Run
Clone repo and execute command:
cat test_data/k8s-operator-kustomize.output | go run ./cmd/helmify mychart
Will generate mychart Helm chart form file test_data/k8s-operator-kustomize.output representing typical operator
kustomize output.
Test
For
Related Skills
node-connect
335.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
335.2kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
82.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
335.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
