Tiny helper that turns comment-annotated values.yaml
files into:
- Go structs – strongly typed, IDE-friendly.
- CustomResourceDefinitions (CRD) – produced by
controller-gen
. - values.schema.json – OpenAPI schema extracted from the CRD.
- README.md – auto-updated
## Parameters
section.
The chain “structs → CRD → OpenAPI” re-uses the same code that Kubernetes itself relies on, so you get maximum type compatibility for free.
graph LR
A[values.yaml] --> B(Go structs)
B --> C[CRD YAML]
C --> D[values.schema.json]
A --> E[README.md]
- Annotate your
values.yaml
(see examples for the exact syntax). - Run cozyvalues-gen; it parses the comments and spits out Go code.
- controller-gen compiles that code, emitting a CRD.
- The tool trims the CRD down to a Helm-compatible schema.
cozyvalues-gen \
--values values.yaml \
--schema values.schema.json
See cozyvalues-gen
-h for all flags.
- Go toolchain must be installed and accessible via
$PATH
.
go install github.com/cozystack/cozyvalues-gen@latest
The binary lands in $(go env GOPATH)/bin
(usually ~/go/bin
). Make sure that directory is on your $PATH
.
Head over to https://github.com/cozystack/cozyvalues-gen/releases, grab the archive for your OS/arch, unpack it somewhere on your $PATH
.
Created for the Cozystack project. 🚀