Turn your ytt data values schema into a documentation site
说明与用途
ytt-schema-docs 工具将大型 ytt 数据值模式转换为带有表格和搜索功能的静态网站,帮助开发者更容易理解键值。
问题
Kubernetes manifests templated with ytt have data values schemas that grow large, making it hard for developers to understand key meanings without scrolling through YAML.
结果
The ytt-schema-docs tool turns a large ytt data values schema into a user‑friendly, searchable static site, improving developer onboarding and reducing lookup time.
工作流
- Export ytt schema to OpenAPI v3 using
ytt --file schema.yaml --data-values-schema-inspect --output openapi-v3 - Patch the OpenAPI
infoblock with site metadata via a tiny ytt overlay - Render the OpenAPI document with openapi-generator using a custom template
- Run a browser script to dereference
$refs, walk the schema depth‑first, and build tables and sidebar with plain DOM APIs - Style the site with Tailwind
- Build the site with
npm run build - Host the resulting
dist/index.htmlon any static file server
证据
The trick is that ytt can export its schema as OpenAPI v3
A tiny ytt overlay patches the info block with the site title, description and version
The site lands in dist as a single index.html with a script and a stylesheet next to it
- 记录日期: 2026-09-22T14:15:36.493Z