Yaml stands for yaml ain't markup language. Markup language- A language that provides child parent relationship . e.g. html.

yaml files

  1. It is a data format used to exchange files. 2.similar to xml & json type.
  2. In yaml you can only store data , and not commands.
  3. data serialization language .
  4. markup language stores document , and yaml stores data,document,object that is why it ain't a markup language.
  5. yaml is case sensitive.

Benifits of yaml files.

  1. Human readable and simple.
  2. it has a strict syntax , indentation is very important.
  3. Easily convertible to xml , json .
  4. most language use yaml files.
  5. More powerful while representing complex data.
  6. Parsing is easy.

extension- .yaml or .yml is used. comments - #this is a comment. !!int - this is the way to specify data types in yaml

Data Types in yaml

  1. strings !!str

Screenshot (71).png

  1. Other data types

Screenshot (72).png

Advance Data Types In Yaml

  1. MAP ( Key value pairs ) !!map

Screenshot (65).png

  1. Sequence (list) !!seq

Screenshot (66).png

  1. pairs (key may have duplicate values) !! pairs

Screenshot (67).png

  1. set ( keys can only have unique values) !!set

Screenshot (69).png

  1. Dictionary !!omap

Screenshot (70).png

ANCHORS

To copy paste set of values in different keys we use anchors example:

Screenshot (73).png

  1. --- is used to specify the end of document
  2. ... is used to indicate end of yaml file

yaml tools you can use.

  1. to check formatting of yaml document click here
  2. to convert yaml to json n another formats click here
  3. few tools that you can check are . lens datree

Thankyou , see you next time Ayush Mishra

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐