YAML is a human-friendly data serialization language for all programming languages.
What does YAML stand for? Yet another markup language. Do you like recursions? Then it stands for – YAML ain’t markup language.
YAML is both a text format and a method for presenting any native data structure in this format.
A YAML node represents a single native data structure. Such nodes have content of one of three kinds: scalar, sequence, or mapping. In addition, each node has a tag which serves to restrict the set of possible values the content can have.
Stuff you wanna know:
- YAML is a versioned language for data.
- YAML can be viewed as a natural superset of JSON.
- There is no direct correlation between XML and YAML.
- YAML’s block collections use indentation for scope and begin each entry on its own line.
- You can express Kubernetes objects in
.yaml
format. - In the
.yaml
file for the Kubernetes object you want to create, you’ll need to set values for the following fields:apiVersion
– Which version of the Kubernetes API you’re using to create this objectkind
– What kind of object you want to createmetadata
– Data that helps uniquely identify the object, including aname
string,UID
, and optionalnamespace
spec
– What state you desire for the object
- You can run an application by creating a Kubernetes Deployment object, and you can describe a Deployment in a YAML file.
- You can create a Secret in a file first, in JSON or YAML format, and then create that object.
- You can update a deployment by applying a new YAML file.
- You can increase the number of Pods in your Deployment by applying a new YAML file.
- Kubernetes manifests can be defined in YAML (or JSON). The file extension
.yaml
or.yml
can be used for YAML. - Kuberntes recommends writing your configuration files using YAML rather than JSON. (Though these formats can be used interchangeably in almost all scenarios, YAML tends to be more user-friendly.)
- Kubelet periodically downloads a file specified by
--manifest-url=<URL>
argument and interprets it as a JSON/YAML file that contains Pod definitions. - You can describe a DaemonSet in a YAML file.
Stuff you wanna know:
- The YAML website — https://yaml.org/
- YAML specs (GitHub) — https://github.com/yaml/yaml-spec
- Configuration using YAML — https://kubernetes.io/docs/concepts/configuration/overview/#general-configuration-tips
- YAML basics in Kubernetes — https://developer.ibm.com/tutorials/yaml-basics-and-usage-in-kubernetes/
- Semantically compare two YAML documents — https://yamldiff.com/
- Validate YAML with JSON — https://json-schema-everywhere.github.io/yaml
- Red Hat on YAML — https://www.redhat.com/en/topics/automation/what-is-yaml
- Mirantis on YAML — https://www.mirantis.com/blog/introduction-to-yaml-creating-a-kubernetes-deployment/
- Working with Google Cloud and Kubernetes YAML — https://cloud.google.com/code/docs/vscode/yaml-editing
- Example YAML for Provisioning Tanzu Kubernetes Clusters — https://docs.vmware.com/en/VMware-vSphere/7.0/vmware-vsphere-with-tanzu/GUID-B2807BCD-0CE1-4C3A-9C0E-2B78F5DA0E90.html
- YAML file for Kubernetes — https://www.juniper.net/documentation/en_US/day-one-books/topics/concept/yaml-file-for-kubernetes.html