KilnVM Live Labs /lab/yq-yaml-json-playground
Step 1 of 3 Docs Build Your Own

Interactive Kubernetes YAML Filtering and Patching with yq

Query multi-document Kubernetes YAML manifests with yq, patch image tags in place, and convert validated YAML resources to JSON in a real Linux terminal.

Step 1 of 3

Extract the current image tag from deploy.yaml

/workspace/deploy.yaml defines a Kubernetes Deployment. Run yq to inspect .spec.template.spec.containers[0].image and save the output to image.txt:

bash
yq '.spec.template.spec.containers[0].image' deploy.yaml > image.txt && cat image.txt

Click Check Step to continue.