1

I've read a couple of online resources and pages to try to understand the actual differences between patch, apply and replace. My current understanding is:

  • apply will declaratively perform the needed updates to the specified resource, if that's not possible it will fail.
  • replace will basically remove the resource and recreate it with updated spec even if the specs are the same.
  • patch, will perform partial runtime update on the specified resource, with patch You can provide only diff to the existing spec and it will work fine.

Assuming the above are correct (if they are not please feel free to correct), if I have the full spec of the running resource, is there any actual benefit of running patch over replace or apply? I'm especially curious about replace vs patch benefits because I'm trying to understand if I need patch at all.

Thanks.

Dominik Wosiński
  • 3,769
  • 1
  • 8
  • 22
  • `replace' assumes you have as yaml the entire current spec plus modification to hand, which 'patch' does not require. In other words, to use 'replace' you're probably making incremental edits to some yaml file, which may be tedious if all you're doing is toggling some option from 'on' to 'off'. – undefined symbol Mar 15 '23 at 23:37

0 Answers0