-
get yq 3.x from https://github.com/mikefarah/yq/releases
-
get jsonnet (Go) from
go get github.com/google/go-jsonnet/cmd/jsonnet go install github.com/google/go-jsonnet/cmd/jsonnet
yq read -j --prettyPrint input.yaml > output.json
bash -c "echo 'std.manifestYamlDoc(' && cat output.json && echo ')'" > output.jsonnet
jsonnetfmt -i --indent 2 --max-blank-lines 2 --sort-imports --string-style s --comment-style s output.jsonnet # fmt
# edit output.jsonnet file here
jsonnet -S output.jsonnet # outputs .yaml