YAML

What is YAML?

YAML (YAML Ain't Markup Language) is a human-readable data serialization language used to store and configure data.

 It is commonly used for configuration files in DevOps tools and applications.

YAML is easy to read and write compared to formats like XML or JSON.

YAML is a human-readable data serialization language used mainly for configuration files in DevOps tools and applications.

Definition:-

History of YAML

YAML was first released in 2001 by:

  • Clark Evans

  • Ingy döt Net

  • Oren Ben-Kiki

The goal was to create a simple, readable configuration language.

Purpose of YAML

1️⃣ Store configuration settings
2️⃣ Define automation workflows
3️⃣ Configure DevOps pipelines
4️⃣ Manage infrastructure and applications

Where YAML is Used

YAML is widely used in DevOps tools such as:

  • Docker

  • Kubernetes

  • GitHub Actions

  • Ansible

 Basic Structure of YAML

YAML uses indentation instead of brackets.

</> YAML
name: Meenal
role: DevOps Engineer
skills:
  - Linux
  - Docker
  - Kubernetes

Explanation:

  • name → key

  • Meenal → value

  • skills → list of items

YAML File Extension

Common YAML file extensions:

  • .yaml

  • .yml

Example:

</> YAML

 

docker-compose.yml
kubernetes.yaml

Basic YAML Elements

</> YAML

 

name: DevOps

Key-Value Pair

</> YAML

tools:
- Git
- Docker
- Jenkins

List

Nested Data

</> YAML

student:
name: Rahul
course: DevOps

 Real-Time Example

</> YAML

 

version: "3"
services:
web:
image: nginx
ports:
- "80:80"

This YAML file tells Docker to run a web server using the Nginx image.

ADVANTAGE AND DISADVANTAGE

Advantages of YAML

✔ Easy to read
✔ Human-friendly syntax
✔ Less complex than XML
✔ Widely used in DevOps tools

Disadvantages of YAML

❌ Sensitive to indentation
❌ Large files can become complex

YAML

By Content ITV

YAML

  • 29