argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.95k stars 5.46k forks source link

Deprecate Replace=true sync option #11573

Open leoluz opened 1 year ago

leoluz commented 1 year ago

Summary

Remove the Replace=true sync option from Argo CD.

Motivation

The sync option to replace the resource state leads to several issues:

We recently had an production outage caused by a sync mistakenly executed with Replace=true.

Proposal

  1. Deprecate the Replace=true sync option.
  2. Stabilize Server-Side Apply addressing existing bugs.
  3. Remove Replace=true when SSA is stable.
n9 commented 1 year ago

@leoluz After reading the tickets you have linked, it seems to me that the issue is caused by using client-side apply.

https://github.com/argoproj/argo-cd/issues/9913 - issue when using client-side apply after replace https://github.com/argoproj/argo-cd/issues/7131 - the issue was caused because the replace=true was not working (ArgoCD was still using client-side apply https://github.com/argoproj/argo-cd/pull/7137) https://github.com/argoproj/argo-cd/issues/9715 - the issue suggests to provide an option to always use replace=true for CRDs

Or am I wrong?

leoluz commented 1 year ago

@n9 Correct. My point was that we need to stabilize/improve server-side apply feature in Argo CD. Basically the diff calculation for SSA needs a different strategy imo. See https://github.com/argoproj/argo-cd/issues/11574