How does Argo CD watch so many resource kinds without polling the API server?
AdvancedConceptArgo CD Architecture & Internals
Answer
On startup per cluster, the controller discovers all API resources and starts a watch (list then watch) for each kind it is allowed to see, except excluded ones. Updates stream into the cluster cache, which maintains parent-child relationships via ownerReferences to build resource trees. When a watched object belonging to an app changes, the app is queued for a refresh. That is efficient for reads but costly in memory and initial sync time on large clusters, which is why resource.exclusions and resource.inclusions exist.
More on Argo CD Architecture & Internals
What are the main components of Argo CD?BeginnerWhat does the argocd-repo-server do, and what does it not do?BeginnerWhat does the application controller do on each reconcile?IntermediateWhat is stored in Redis, and what happens if Redis is lost?IntermediateWhy is the application controller a StatefulSet rather than a Deployment?AdvancedWhere does Argo CD keep its configuration?Beginner