DO IT IN CODE (NOT YAML)! Fedor Korotkov Viktor Gamov @fedor @gamussa Copenhagen Denmark
MEME REVIEW Sarcastic View on Existential Problems with YAML
bash ??? YAML
A BIT MORE SERIOUS NOW Sarcastic View on the Real Problems with YAML
WHY YAML IN THE FIRST PLACE ● Initial Release in 2001 ● Originally Yet Another Markup Language ● Repurposed as YAML Ain't Markup Language ● From Wiki: “commonly used for configuration files” ● End goal is to declare something ● YAML is not going anywhere any time soon
YAML IS TYPELESS
THERE IS A SCHEMA THOUGH json-schema.org
INTELLIJ SUPPORTS JSON SCHEMAS FOR YAML
YAML IS GREAT but for small things
EVOLUTION OF YAML IN A COMPANY KOTLIN HELM DSL ANSIBLE YAML YAML SCRIPTS NO YAML
KUBERNETES Photo caption
KUBERNETES ARCHITECTURE Actually JSON image source: Janakiram MSV
THINGS TO THINK ABOUT YAML FOR K8S AT SCALE ● How to avoid copy-pasting? ● How to provide primitives? ● How to allow customization for teams? ● How to test incremental changes? ● Some tools to analyze current state of clusters
INGRESS EXAMPLE
KOTLIN DSL FOR KUBERNETES github.com/fkorotkov/k8s-kotlin-dsl
HOW IT WORKS
DSL GENERATION ● Generates DSLs from fabric8 types ● Generates fabric8 types from deployed CRDs 😆
Confluent Operator Architecture
KOTLIN POWER: BUILDERS
KOTLIN POWER: BUILDERS
KOTLIN POWER: EXTENSION FUNCTIONS
KOTLIN POWER: EXTENSION FUNCTIONS
USE CASES
DEMO
THANK YOU AND REMEMBER TO VOTE Fedor Korotkov @fedor Viktor Gamov @gamussa #KotlinConf
Recommend
More recommend