Update the image of one container
Set a new image only for the container named app
yq -i '(.spec.template.spec.containers[] | select(.name == "app") | .image) = "myapp:v2.0.0"' deployment.yaml
- tool
- yq15 commands
More yq commands
-
yq '.metadata.name' manifests/*.yamlPrint metadata.name from every YAML file in manifests/
-
yq '.spec.replicas' deployment.yamlExtract a value from a YAML file
-
yq -i '.spec.replicas = 3' deployment.yamlIn-place update of a YAML field
-
yq -o=json deployment.yamlPrint YAML as JSON, for example to pass it to jq
-
yq '. *= load("override.yaml")' base.yamlDeep-merge base.yaml with values from override.yaml