In a short note, YAML files represent configuration data in most of the times. According to Wikipedia: YAML "is a human-friendly data serialization standard for all programming languages". Basically we can say that is similar to XML and JSON notation and it is pretty used on DevOps activities for IaC configurations and for sharing data across multiple applications.
-
key-Value Pair: there's nothing more to say to this. You have a "Key" that acts as an Identification for value itself.
Here's an example:
Key: Value
-
Array and Lists: is the same data structure, just like any programming language.
Here's an example:
Fruits:
- Apple
- Orange
- Banana
-
Dictionaries and Maps: it is a common data structure equivalent to a hash map
Here's an example:
Fruits:
Cal : 104
For this structure is very important the usage of blank spaces for hierarchy purposes (indentation)
A typical dictionary example is a
Car
with multiple internal properties represented byKey-Value pair
representation, but aParking lot
example is represented by a couple of dictionaries.
- Properties can be defined without any order
- For arrays, item order matter
- In case of having two dictionaries, they will be considered the same if their properties are equal without an order
- The
#
is for comments
YAML is a powerful markup language (short for "YAML Ain't Markup Language") is a human-readable data serialization language that is commonly used in container technology. YAML is a lightweight and simple language that allows for easy configuration of containerized applications. YAML drives, container technology, and thanks to YAML NetDevOps was born.
In container technology, YAML files are used to define the configuration and settings for containerized applications. These files can be used to define the container's image, network settings, environment variables, volumes, and other important details. YAML files are often used in combination with container orchestration tools, such as Kubernetes or Docker Compose, to manage and deploy containerized applications across multiple nodes or hosts. These tools use YAML files to describe the desired state of the containerized application, and then orchestrate the deployment and management of the application based on that configuration.
YAML is a popular choice in container technology because of its simplicity and ease of use. It allows developers and system administrators to quickly and easily configure and manage containerized applications, making it an essential tool for container-based infrastructure.