How to edit all the deployment of kubernetes at a time
问题 We have hundreds of deployment and in the config we have imagePullPolicy set as “ifnotpresent” for most of them and for few it is set to “always” now I want to modify all deployment which has ifnotpresent to always . How can we achieve this with at a stroke? Ex: kubectl get deployment -n test -o json | jq ‘.spec.template.spec.contianer[0].imagePullPolicy=“ifnotpresent”| kubectl -n test replace -f - The above command helps to reset it for one particular deployment. 回答1: Kubernetes doesn't