YAML Magic

Julien Pivotto
Julien PivottoOpen Source Consultant at Inuits
CfgMgmtCamp Ghent
Julien Pivotto
@roidelapluie
---
yaml magic
February 03 2020
---
yaml enables you to have multiple documents
---
in the same file
Multiple documents
@roidelapluie
# Those keys have the same value
implicit:
explicit: null
# Those keys have the different values
nothing: null
string: "null"
Values
@roidelapluie
maybe_countries:
- be
- fr
- nl
- no
# Those mean true and false
[on,off,ON,OFF,yes,Yes,No,no,YES,NO]
Values
@roidelapluie
# Version numbers
version: 1.3.0
# NOT a version number
version: 1.3
# that's a float!
Values
@roidelapluie
did you know: spaces are allowed in keys
Keys
@roidelapluie
did you know: you can have duplicate keys
did you know: this is valid yaml
Keys
@roidelapluie
.50: keys can be something else than strings
Keys
@roidelapluie
? |
keys can have
multiple lines
: yes yes
Keys
@roidelapluie
didyouknow: another thing about keys
: EMPTY keys are also a thing
Keys
@roidelapluie
long: |
You can easily write
multi line text in yaml
by using this syntax
You can easily write
multi line text in yaml
by using this syntax
Multiline
@roidelapluie
long: >
You can easily write
multi line text in yaml
by using this syntax
You can easily write multi line text in yaml by using
Multiline
@roidelapluie
long: |-
You can easily write
multi line text in yaml
by using this syntax
No newline at the end
@roidelapluie
long: |+
You can easily write
multi line text in yaml
by using this syntax
You can easily write
multi line text in yaml
by using this syntax
All newlines at the end
@roidelapluie
set:
? item1
? item2
? item2
set: {item1, item2, item2}
set:
item1:
item2:
Sets
@roidelapluie
ghent: &belgian_city
country: be
mainland: europe
antwerp: *belgian_city
ghent:
country: be
mainland: europe
antwerp:
country: be
mainland: europe
Anchors
@roidelapluie
ghent: &belgian_city
country: be
has tld: yes
antwerp:
<<*: belgian_city
has tld: no
ghent:
country: be
has tld: true
antwerp:
country: be
has tld: false
Inheritance
@roidelapluie
{"note": "maybe at the end we just want json"}
oh yeah
@roidelapluie
those tips are fun but I'd recommend you keep the
magic far from your prod because the magician on call
might not like reading the yaml spec at 3am :)
use jsonnet
@roidelapluie
Julien Pivotto
@roidelapluie
roidelapluie@inuits.eu
Essensteenweg 31
2930 Brasschaat
Belgium
Contact:
info@inuits.eu
+32-3-8082105
1 of 20

Recommended

YAML Tips For Kubernetes by Neependra Khare by
YAML Tips For Kubernetes by Neependra KhareYAML Tips For Kubernetes by Neependra Khare
YAML Tips For Kubernetes by Neependra KhareCodeOps Technologies LLP
5.4K views19 slides
Cloud Monitoring tool Grafana by
Cloud Monitoring  tool Grafana Cloud Monitoring  tool Grafana
Cloud Monitoring tool Grafana Dhrubaji Mandal ♛
1.7K views35 slides
Kubernetes #1 intro by
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 introTerry Cho
1.5K views44 slides
Introduction to helm by
Introduction to helmIntroduction to helm
Introduction to helmJeeva Chelladhurai
3.7K views9 slides
DevOps Open House III - Kubernetes using YAML by
DevOps Open House III - Kubernetes using YAMLDevOps Open House III - Kubernetes using YAML
DevOps Open House III - Kubernetes using YAMLAgile Testing Alliance
308 views26 slides
DevOps with Ansible by
DevOps with AnsibleDevOps with Ansible
DevOps with AnsibleSwapnil Jain
1.8K views19 slides

More Related Content

What's hot

Grafana by
GrafanaGrafana
GrafanaNoelMc Grath
5.3K views14 slides
Ingress overview by
Ingress overviewIngress overview
Ingress overviewHarshal Shah
1.5K views14 slides
Introduction to Ansible by
Introduction to AnsibleIntroduction to Ansible
Introduction to AnsibleKnoldus Inc.
24.2K views18 slides
Terraform on Azure by
Terraform on AzureTerraform on Azure
Terraform on AzureJulien Corioland
1.7K views14 slides
Continuous Integration/Deployment with Gitlab CI by
Continuous Integration/Deployment with Gitlab CIContinuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIDavid Hahn
6K views27 slides
Introduction to Gitlab by
Introduction to GitlabIntroduction to Gitlab
Introduction to GitlabJulien Pivotto
20.7K views22 slides

What's hot(20)

Introduction to Ansible by Knoldus Inc.
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
Knoldus Inc.24.2K views
Continuous Integration/Deployment with Gitlab CI by David Hahn
Continuous Integration/Deployment with Gitlab CIContinuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CI
David Hahn6K views
Introduction to Gitlab by Julien Pivotto
Introduction to GitlabIntroduction to Gitlab
Introduction to Gitlab
Julien Pivotto20.7K views
Kubernetes - A Comprehensive Overview by Bob Killen
Kubernetes - A Comprehensive OverviewKubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive Overview
Bob Killen26.5K views
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft... by Amazon Web Services
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Amazon Web Services10.4K views
Azure DevOps Best Practices Webinar by Cambay Digital
Azure DevOps Best Practices WebinarAzure DevOps Best Practices Webinar
Azure DevOps Best Practices Webinar
Cambay Digital787 views
Airflow presentation by Ilias Okacha
Airflow presentationAirflow presentation
Airflow presentation
Ilias Okacha3.6K views
Introduction to Prometheus by Julien Pivotto
Introduction to PrometheusIntroduction to Prometheus
Introduction to Prometheus
Julien Pivotto6.7K views
Grafana introduction by Rico Chen
Grafana introductionGrafana introduction
Grafana introduction
Rico Chen8.8K views
Crossplane @ Mastering GitOps.pdf by QAware GmbH
Crossplane @ Mastering GitOps.pdfCrossplane @ Mastering GitOps.pdf
Crossplane @ Mastering GitOps.pdf
QAware GmbH547 views
Introducing GitLab (June 2018) by Noa Harel
Introducing GitLab (June 2018)Introducing GitLab (June 2018)
Introducing GitLab (June 2018)
Noa Harel5.9K views

More from Julien Pivotto

The O11y Toolkit by
The O11y ToolkitThe O11y Toolkit
The O11y ToolkitJulien Pivotto
38 views24 slides
What's New in Prometheus and Its Ecosystem by
What's New in Prometheus and Its EcosystemWhat's New in Prometheus and Its Ecosystem
What's New in Prometheus and Its EcosystemJulien Pivotto
12 views42 slides
Prometheus: What is is, what is new, what is coming by
Prometheus: What is is, what is new, what is comingPrometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is comingJulien Pivotto
43 views27 slides
What's new in Prometheus? by
What's new in Prometheus?What's new in Prometheus?
What's new in Prometheus?Julien Pivotto
15 views10 slides
Introduction to Grafana Loki by
Introduction to Grafana LokiIntroduction to Grafana Loki
Introduction to Grafana LokiJulien Pivotto
201 views11 slides
Why you should revisit mgmt by
Why you should revisit mgmtWhy you should revisit mgmt
Why you should revisit mgmtJulien Pivotto
10 views46 slides

More from Julien Pivotto(20)

What's New in Prometheus and Its Ecosystem by Julien Pivotto
What's New in Prometheus and Its EcosystemWhat's New in Prometheus and Its Ecosystem
What's New in Prometheus and Its Ecosystem
Julien Pivotto12 views
Prometheus: What is is, what is new, what is coming by Julien Pivotto
Prometheus: What is is, what is new, what is comingPrometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is coming
Julien Pivotto43 views
Introduction to Grafana Loki by Julien Pivotto
Introduction to Grafana LokiIntroduction to Grafana Loki
Introduction to Grafana Loki
Julien Pivotto201 views
Observing the HashiCorp Ecosystem From Prometheus by Julien Pivotto
Observing the HashiCorp Ecosystem From PrometheusObserving the HashiCorp Ecosystem From Prometheus
Observing the HashiCorp Ecosystem From Prometheus
Julien Pivotto37 views
Monitoring in a fast-changing world with Prometheus by Julien Pivotto
Monitoring in a fast-changing world with PrometheusMonitoring in a fast-changing world with Prometheus
Monitoring in a fast-changing world with Prometheus
Julien Pivotto33 views
5 tips for Prometheus Service Discovery by Julien Pivotto
5 tips for Prometheus Service Discovery5 tips for Prometheus Service Discovery
5 tips for Prometheus Service Discovery
Julien Pivotto38 views
Prometheus and TLS - an Introduction by Julien Pivotto
Prometheus and TLS - an IntroductionPrometheus and TLS - an Introduction
Prometheus and TLS - an Introduction
Julien Pivotto15 views
HAProxy as Egress Controller by Julien Pivotto
HAProxy as Egress ControllerHAProxy as Egress Controller
HAProxy as Egress Controller
Julien Pivotto2.9K views
Improved alerting with Prometheus and Alertmanager by Julien Pivotto
Improved alerting with Prometheus and AlertmanagerImproved alerting with Prometheus and Alertmanager
Improved alerting with Prometheus and Alertmanager
Julien Pivotto4.5K views
SIngle Sign On with Keycloak by Julien Pivotto
SIngle Sign On with KeycloakSIngle Sign On with Keycloak
SIngle Sign On with Keycloak
Julien Pivotto10K views
Monitoring as an entry point for collaboration by Julien Pivotto
Monitoring as an entry point for collaborationMonitoring as an entry point for collaboration
Monitoring as an entry point for collaboration
Julien Pivotto1.3K views
Monitor your CentOS stack with Prometheus by Julien Pivotto
Monitor your CentOS stack with PrometheusMonitor your CentOS stack with Prometheus
Monitor your CentOS stack with Prometheus
Julien Pivotto712 views
Monitor your CentOS stack with Prometheus by Julien Pivotto
Monitor your CentOS stack with PrometheusMonitor your CentOS stack with Prometheus
Monitor your CentOS stack with Prometheus
Julien Pivotto704 views

Recently uploaded

Business Analyst Series 2023 - Week 4 Session 7 by
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7DianaGray10
146 views31 slides
The Role of Patterns in the Era of Large Language Models by
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language ModelsYunyao Li
91 views65 slides
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... by
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Moses Kemibaro
35 views38 slides
Qualifying SaaS, IaaS.pptx by
Qualifying SaaS, IaaS.pptxQualifying SaaS, IaaS.pptx
Qualifying SaaS, IaaS.pptxSachin Bhandari
1.1K views8 slides
This talk was not generated with ChatGPT: how AI is changing science by
This talk was not generated with ChatGPT: how AI is changing scienceThis talk was not generated with ChatGPT: how AI is changing science
This talk was not generated with ChatGPT: how AI is changing scienceElena Simperl
32 views13 slides
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... by
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...The Digital Insurer
91 views52 slides

Recently uploaded(20)

Business Analyst Series 2023 - Week 4 Session 7 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10146 views
The Role of Patterns in the Era of Large Language Models by Yunyao Li
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language Models
Yunyao Li91 views
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... by Moses Kemibaro
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Moses Kemibaro35 views
This talk was not generated with ChatGPT: how AI is changing science by Elena Simperl
This talk was not generated with ChatGPT: how AI is changing scienceThis talk was not generated with ChatGPT: how AI is changing science
This talk was not generated with ChatGPT: how AI is changing science
Elena Simperl32 views
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... by The Digital Insurer
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...
AIM102-S_Cognizant_CognizantCognitive by PhilipBasford
AIM102-S_Cognizant_CognizantCognitiveAIM102-S_Cognizant_CognizantCognitive
AIM102-S_Cognizant_CognizantCognitive
PhilipBasford21 views
Digital Personal Data Protection (DPDP) Practical Approach For CISOs by Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash162 views
Discover Aura Workshop (12.5.23).pdf by Neo4j
Discover Aura Workshop (12.5.23).pdfDiscover Aura Workshop (12.5.23).pdf
Discover Aura Workshop (12.5.23).pdf
Neo4j15 views
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」 by PC Cluster Consortium
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」
"Running students' code in isolation. The hard way", Yurii Holiuk by Fwdays
"Running students' code in isolation. The hard way", Yurii Holiuk "Running students' code in isolation. The hard way", Yurii Holiuk
"Running students' code in isolation. The hard way", Yurii Holiuk
Fwdays36 views
Measurecamp Brussels - Synthetic data.pdf by Human37
Measurecamp Brussels - Synthetic data.pdfMeasurecamp Brussels - Synthetic data.pdf
Measurecamp Brussels - Synthetic data.pdf
Human37 26 views
Future of AR - Facebook Presentation by Rob McCarty
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
Rob McCarty65 views
NTGapps NTG LowCode Platform by Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu437 views
Innovation & Entrepreneurship strategies in Dairy Industry by PervaizDar1
Innovation & Entrepreneurship strategies in Dairy IndustryInnovation & Entrepreneurship strategies in Dairy Industry
Innovation & Entrepreneurship strategies in Dairy Industry
PervaizDar135 views
Transcript: Redefining the book supply chain: A glimpse into the future - Tec... by BookNet Canada
Transcript: Redefining the book supply chain: A glimpse into the future - Tec...Transcript: Redefining the book supply chain: A glimpse into the future - Tec...
Transcript: Redefining the book supply chain: A glimpse into the future - Tec...
BookNet Canada41 views

YAML Magic