>_ IzzyLab

Topic breakdown

yq can not only read YAML but also modify it: an expression of the form .path = value changes the field at the given path. On its own, such an expression only prints the modified document to output — to write the change back to the file you need the in-place flag -i, exactly like with sed. The mental model: you describe a transformation of the document tree, and the flag decides where the result goes — to the stream or back into the file.

What's checked

  1. replicas changed to 5 in the file
  2. the rest of the YAML is untouched

What it looks like