Helmify
Helmify reads kubernetes resources from std.in and produces a Helm chart.
Main use-case is to create Helm charts for kubernetes operators build with
Operator-SDK or Kubebuilder.
Run
Clone repo and execute command:
cat test_data/kustomize.output | go run cmd/helmify/main.go mychart
Will generate mychart
Helm chart form file test_data/kustomize.output
representing typical
kustomize output.
Integrate to your Operator-SDK/Kubebuilder project
Tested with operator-sdk version: "v1.8.0".
- Open
Makefile
in your operator project generated by
Operator-SDK or Kubebuilder.
- Add these lines to
Makefile
:
HELMIFY = $(shell pwd)/bin/helmify
helmify:
$(call go-get-tool,$(HELMIFY),github.com/arttor/helmify/cmd/helmify@v0.2.0)
helm: manifests kustomize helmify
$(KUSTOMIZE) build config/default | $(HELMIFY)
- Run
make helm
in project root. It will generate helm chart with name 'chart' in 'chart' directory.
Available options
Helmify takes a chart name for an argument.
Usage:
helmify CHART_NAME [flags]
- CHART_NAME
is optional. Default is 'chart'.
flag |
description |
sample |
-h -help |
Prints help |
helmify -h |
-v |
Enable verbose output. |
helmify -v |
Status
Supported default operator resources:
- deployment
- service
- RBAC (serviceaccount, (cluster-)role, (cluster-)rolebinding)
- configs (configmap, secret)
- webhooks (cert, issuer, ValidatingWebhookConfiguration)
Known issues
- Helmify will not overwrite
Chart.yaml
file if presented. Done on purpose.
- Helmify will not delete existing template file, only overwrite. So, if you delete CRD, re-run
kustomize | helmify
crd file will still be in templates directory. (todo: add option for this)
- Helmify overwrites templates and values files on every run.
This meas that all your manual changes in helm template files will be lost on the next run.
Use kustomize /config folder as a single source of true and make changes there.