Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Server-Side Diff in Argo CD controller #11574

Closed
leoluz opened this issue Dec 6, 2022 · 1 comment · Fixed by argoproj/gitops-engine#522 or #13663
Closed

Implement Server-Side Diff in Argo CD controller #11574

leoluz opened this issue Dec 6, 2022 · 1 comment · Fixed by argoproj/gitops-engine#522 or #13663
Labels
enhancement New feature or request

Comments

@leoluz
Copy link
Collaborator

leoluz commented Dec 6, 2022

Summary

Introduce a new diff option to enable calculating diffs using server-side apply dryrun.

Motivation

Argo CD controller implements a diff logic comparing desired and live state to define if the resource is out of sync. With the introduction of Server-Side Apply as a new sync option in 2.5, a new diff logic was implemented trying to reproduce what Kubernetes does while calculating patches during SSA syncs. The new diff logic introduces new challenges to Argo CD controller as it has to keep a local cache of all CRD schemas from all clusters it syncs to. There are different issues with this approach but the main problems are:

Addressing the root of those issues will require a deeper dive in Kubernetes Server-Side Apply logic to try to bring that same functionality to Argo CD controller. This may lead to inconsistencies and will likely require a relatively big engineering effort to stabilize the feature.

Proposal

  1. Introduce a new diff option to enable Server-Side Diff
  2. Server-Side Diff will execute a server-side apply in dryrun mode
  3. Argo CD controller will cache the SSA response to avoid hitting kube-api too often
  4. SSA response state will be used to compare with live state

This will also address the current limitation with admission controllers as mutating webhooks are only executed in the cluster.

@leoluz
Copy link
Collaborator Author

leoluz commented Dec 19, 2023

Will be available as part of Argo CD 2.10-rc1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Completed
2 participants