cozyvalues-gen
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.
How it works
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.
Usage (one-liner)
cozyvalues-gen \
--values values.yaml \
--schema values.schema.json
See cozyvalues-gen -h for all flags.
Created for the Cozystack project. 🚀