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