Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yeahdongcn/kustohelmize

Tired of creating Helm Charts from scratch? Try Kustohelmize today!
https://github.com/yeahdongcn/kustohelmize

helm kubernetes kustomize

Last synced: 3 months ago
JSON representation

Tired of creating Helm Charts from scratch? Try Kustohelmize today!

Awesome Lists containing this project

README

        

# Kustohelmize
[![Go Report Card](https://goreportcard.com/badge/github.com/yeahdongcn/kustohelmize)](https://goreportcard.com/report/github.com/yeahdongcn/kustohelmize)

GitHub last commit (branch)
GitHub

Kustohelmize lets you easily create a Helm Chart from a [kustomized](https://github.com/kubernetes-sigs/kustomize) YAML file.

## CLI

kustohelmize

```
❯ ./kustohelmize
Automate Helm chart creation from any existing Kubernetes manifests

Usage:
kustohelmize [command]

Available Commands:
completion Generate the autocompletion script for the specified shell
create Create a chart from a given YAML file
help Help about any command
version print the client version information

Flags:
-h, --help help for kustohelmize

Use "kustohelmize [command] --help" for more information about a command.
```

kustohelmize create

```
❯ ./kustohelmize create --help
Create a new Helm chart

Usage:
kustohelmize create NAME [flags]

Flags:
-a, --app-version string The version of the application enclosed inside of this chart
-d, --description string A one-sentence description of the chart
-f, --from string The path to a kustomized YAML file
-h, --help help for create
-k, --kubernetes-split-yaml-command string kubernetes-split-yaml command (path to executable) (default "kubernetes-split-yaml")
-p, --starter string the name or absolute path to Helm starter scaffold
-s, --suppress-namespace Whether to suppress creation of namespace resource, which Kustomize will emit. RBAC bindings for SAs will be to {{ .Release.Namespace }}
-v, --version string A SemVer 2 conformant version string of the chart
```

## User scenario

### Work with [kustomize](https://kustomize.io/).

Say you have a project created by [Operator SDK](https://sdk.operatorframework.io/) and the `Makefile` should look like this:

```Makefile
.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMAGE}
$(KUSTOMIZE) build config/default | kubectl apply -f -
```

`make deploy` will create the YAML file with `kustomize` and deploy it into the cluster. This might be good enough during development, but may not very helpful for end-users.

We can slightly duplicate the target and update it like this:

```Makefile
.PHONY: helm
helm: manifests kustomize kustohelmize
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMAGE}
$(KUSTOMIZE) build config/default --output config/production.yaml
$(KUSTOHELMIZE) --from=config/production.yaml create mychart
```

Then a Helm chart with default configurations will be created for you. The directory hierarchy will look like this:

```
.
├── mychart
├── mychart-generated
└── mychart.config
```

The full example from scratch can be found at [examples](https://github.com/yeahdongcn/kustohelmize/tree/main/examples).

Note that you can use this tool in an ad-hoc manner against any YAML file containing multiple resources to generate a helm chart skeleton simply by pointing `--from` at that file.

## Community

* [Open an issue](https://github.com/yeahdongcn/kustohelmize/issues/new)