Watch our latest talk from KubeCon + CloudNativeCon EU 2024!
Carvel Logo

All your YAML shaping in one tool

Template and patch as needed to easily make your configuration reusable and extensible. Works with your own and third-party YAML configuration.

Structure-oriented

ytt templates are plain YAML documents made from nodes such as maps and arrays. ytt allows you to set values and attach statements (such as if and for loops) on those nodes. This eliminates text insertion concerns like manual escaping and allows for easy structure reuse, thus, increasing readability.

Modularized Config

Weave ytt templating into your own configuration, externalize values to variables, extract repeated snippets to functions, and make whole sections conditional. Patch on top of any configuration using ytt overlays. Express precise structural edits and invariant declaratively.

Deterministic

ytt execution environment is hermetic and side-effect free, with no access to filesystem, network, time, randomness, or the operating system interfaces. This guarantees that templates produce identical output with the same inputs. Your configuration changes only when you change it.

Features

Intuitive templating

Makes template code look familiar by including a sandboxed Pythonic language.
e.g. "-listen=:" + str(port)

Overlays

Patch YAML structures via the builtin overlay package.

Any YAML

Template any YAML content, including, Kubernetes configuration, Concourse pipelines, Docker Compose files, etc.

Basic Usage

# Configurations picked up from a directory
$ ytt -f playground/basics/example-demo/ | kubectl apply -f-
# Input customized on command line or file configuration
$ ytt -f playground/basics/example-demo/ --data-value-yaml service.enabled=false | ...
# Give as many configuration files as needed
$ ytt -f playground/basics/example-demo/ -f values-staging.yml -f overlay-env-1.yml | ...

Getting started

To help you get started, see the documentation.