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

https://github.com/dipsas/operator-helm-gen


https://github.com/dipsas/operator-helm-gen

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

        

# operator-helm-gen

Very simple app for making resources created by [operator-sdk](https://github.com/operator-framework/operator-sdk) ready for inclusion in Helm templates.

"Very simple" means:
- RoleBinding, Role and other namespaced K8s RBAC resources generated by operator-sdk get their hard-coded namespace element(s) templatable.
- The resulting files are named following the pattern `resource_type-resource_name.yaml`.

## Using

The program uses stdin for delivering the payload (example below). The input must be in YAML format, with the separator **---** between each resource.

In addition, the program accepts the following command line arguments:

- `keep`: The resource types to inspect and generate for if found in the payload.
- `dir`: The directory to place the generated YAML files. If empty, stdout is used. The program does NOT check if the directory exists.
- `version`: Prints the version (if used with `go install`) and exits.

Example usage:

```bash
GOBIN=$(pwd)/bin
go install github.com/DIPSAS/operator-helm-gen/cmd/[email protected]

mkdir -p /some-dir/generated
./bin/kustomize build config/default | ./bin/operator-helm-gen --dir /some-dir/generated --keep ClusterRoleBinding,RoleBinding,CustomResourceDefinition,Role,ClusterRole
cp -a /some-dir/generated/. /path/to/helm-templates
rm -rf /some-dir/generated

```