https://github.com/dipsas/operator-helm-gen
https://github.com/dipsas/operator-helm-gen
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dipsas/operator-helm-gen
- Owner: DIPSAS
- License: apache-2.0
- Created: 2024-07-22T20:03:10.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-08-27T22:44:53.000Z (10 months ago)
- Last Synced: 2025-01-10T11:04:15.569Z (6 months ago)
- Language: Go
- Size: 19.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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```