YAML

113

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:

  1. YAML is a versioned language for data.
  2. YAML can be viewed as a natural superset of JSON.
  3. There is no direct correlation between XML and YAML.
  4. YAML’s block collections use indentation for scope and begin each entry on its own line.
  5. You can express Kubernetes objects in .yaml format.
  6. 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 object
    • kind – What kind of object you want to create
    • metadata – Data that helps uniquely identify the object, including a name string, UID, and optional namespace
    • spec – What state you desire for the object
  7. You can run an application by creating a Kubernetes Deployment object, and you can describe a Deployment in a YAML file.
  8. You can create a Secret in a file first, in JSON or YAML format, and then create that object.
  9. You can update a deployment by applying a new YAML file.
  10. You can increase the number of Pods in your Deployment by applying a new YAML file.
  11. Kubernetes manifests can be defined in YAML (or JSON). The file extension .yaml or .yml can be used for YAML.
  12. 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.)
  13. Kubelet periodically downloads a file specified by --manifest-url=<URL> argument and interprets it as a JSON/YAML file that contains Pod definitions.
  14. You can describe a DaemonSet in a YAML file.

Stuff you wanna know: