operator-helm-gen

module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2025 License: Apache-2.0

README

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/operator-helm-gen@v0.1.2

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

Directories

Path Synopsis
cmd
pkg
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL