Skip to content

Conversation

@Mangaal
Copy link
Contributor

@Mangaal Mangaal commented Dec 2, 2025

Summary

This PR refactors the argocd-resource-tracker CLI around a analyser abstraction with two pluggable backends:

1. Dynamic backend (strategy=dynamic)
2. Cyphernetes graph backend (strategy=graph)

Both backends follow the same high-level workflow:

  • Use the Argo CD API to discover Applications and their destination clusters.
  • Fetch direct child manifests for each Application from the repo-server (RepoServerManager.GetApplicationChildManifests).
  • Compute all descendant resources per Application.
  • Augment results from the query with resource kinds from Application.status if queries partially fail or clusters are unreachable.

Dynamic backend (strategy=dynamic)

  1. For every Argo CD Application, it resolves the destination Cluster and talks to that cluster’s Kubernetes API using the same credentials Argo CD uses.
  2. Gets the direct children from the repo‑server.
  3. For each destination cluster, it discovers API resources and walks all namespaced objects, building a parent→child graph from metadata.ownerReferences.
  4. Uses a shared, cross‑cluster cache where Parent→child relations discovered are stored and reused across applications and clusters to build the relation.

Cyphernetes graph backend (strategy=graph)

  1. Use the Argo CD API to discover Applications and their destination clusters.
  2. Fetches direct child manifests using the same repo-server mechanism.
  3. Connects to the Cyphernetes graph.QueryServer for each destination cluster.
  4. Treats each direct child as a root and runs Cyphernetes graph queries to discover all nested resources (workloads, services, etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant