Merge two YAML files yq
Deep-merge two YAML documents
yq eval-all 'select(fileIndex==0) * select(fileIndex==1)' base.yaml override.yaml
more yq
all 15 commands →
Convert YAML to JSON
yq -o=json '.' config.yaml
Convert JSON to YAML
cat config.json | yq -P '.'
Filter array items by condition
yq '.items[] | select(.status.phase == "Running")' pods.yaml
Update image tag across manifests
yq -i '(.spec.template.spec.containers[] | select(.name == "app") | .image) = "myapp:v2.0.0"' deployment.yaml
Process multiple files at once
yq '.metadata.name' manifests/*.yaml