Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 1.32 KB

README.md

File metadata and controls

30 lines (20 loc) · 1.32 KB

operator-helm-gen

Very simple app for making resources created by 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:

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