Need to understand exactly how patch works. How could I patch "imagePullPolicy" for instance. Could someone explain in simple details how patch works.
kubectl patch statefulset my-set -p '{"spec":{"containers":{"imagePullPolicy":"IfNotPresent"}}}'
This is not working what is wrong with it?
In addition to @Colwins answer, you should also add mandatory key name into container spec, otherwise you'll get does not contain declared merge key: name
So, you kubectl command should look like:
kubectl patch statefulset my-set -p '{"spec": {"template": {"spec":{"containers":[{"name":"nginx","imagePullPolicy":"Never"}]}}}}'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With