YAML Engineering:
Why we need a new paradigm
Raphaël Pinson
Raphaël Pinson
○ Infrastructure Developer / DevOps
○ Augeas & Augeasproviders
○ Voxpupuli
@raphink
YAML
YAML’s qualities
■ Easy to read by humans
■ Easy to parse by machines
■ Can be used for simple configurations (conf files)
■ Can be used to store data (e.g. Puppet’s Hiera)
A bit of history
■ 1999: XML + XSLT
■ 2001: YAML
■ 2002: JSON
(Javascript Object Notation)
YAML != XML
■ YAML Ain’t Markup Language
■ Serialization format
■ Maps to Hashes/Arrays
Say to dynamic typing🇳🇴
https://noyaml.com/
And more number issues
Data Types
■ YAML has (loose) data types
■ Some languages (e.g. Ruby) dynamically
load types as classes:
[10] pry(main)> Puppet.settings.to_yaml.split("n").first
=> "--- &1 !ruby/object:Puppet::Settings"
■ Security problem
Too Many Config Formats
We just need a new format
YAML as a DSL
The Scaling Problem
Pointers anyone?
■ Factor repetition
■ Not cross-files
■ Potentially harmful
Templating vs patching
■ Ansible: Jinja2
■ Helm: Go templates
■ Kompose: patch (merge)
Templating YAML
Configuration Complexity Clock
https://www.youtube.com/watch?v=lb698Gy8Kow
Need for Declarative
■ Idempotence
■ Convergence / Congruence
Generators, frontends & DSLs
YAML is data, not code
“Nobody will ever want to program
in YAML and Jinja.”
Adam Jacob
In Kubernetes
■ June 2014:
YAML added as
an alternative to JSON
■ Server starts accepting
YAML
■ Expected to be a
temporary solution
https://www.youtube.com/watch?v=8PpgqEqkQWA
A bit of history (continued)
■ 1999: XML + XSLT
■ 2001: YAML
■ 2002: JSON (Javascript Object Notation)
■ 2014: Jsonnet
■ 2019: Google CUE + YTT
■ 2020: Dhall
Generating YAML (or JSON)
■ Most languages can output YAML/JSON
■ But we want declarative code!
■ Avoid imperative coding as much as possible, if possible
make it impossible.
Jsonnet
■ Data templating langage
■ Simple extension of JSON
https://jsonnet.org/
Kapitan
■ Generic templated configuration management
for Kubernetes, Terraform & other things
■ Uses Jsonnet, Kadet (alpha) & Jinja2
■ Components + templates + inventory classes
https://kapitan.dev/
Cue
■ Data-constraint langage
■ Validate, define & use dynamic or text-based data
https://cuelang.org/
YTT
■ VMWare Tanzu
■ Template and patch YAML
Dhall
■ Programmable configuration language
■ JSON + functions + types + imports
■ Based on Haskell
■ Not Turing-complete
guaranteed to return
https://dhall-lang.org
Terraform Kubernetes Provider
■ HCL DSL
■ Stable
■ No generic manifest
resource type
Terraform Kubernetes Alpha Provider
■ DSL
■ Alpha
■ Generic manifests
Pulumi
■ Similar to Terraform in concept/goal
■ Supports multiple languages as DSL:
○ Node.js
○ Python
○ Go
○ .NET Core
○ Go
JOIN US !
camptocamp.com/career
YAML Engineering: why we need a new paradigm

YAML Engineering: why we need a new paradigm