argoproj / argo-cd

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

Ignore orphaned resources matching certain labels #7418

Open silverraven691 opened 2 years ago

silverraven691 commented 2 years ago

Summary

I would like to be able to ignore orphaned resources that match a certain label

Motivation

An operator in my cluster generates resources in each namespace, they don't have ownerReferences (probably impossible), but they do have labels. ArgoCD considers those to be orphaned

Proposal

Add more selector capabilities to spec.orphanedResources.ignore in AppProject

dtrts commented 1 year ago

I would also like a feature which addresses this.

In our case we are migrating to ArgoCD for deploying our resources. There is a legacy deployment process for stateless apps and creates ReplicaSets, ConfirMaps, Services, Ingresses etc for each app. Due to the scale this has lead to 1000s of resources managed by another system but considered an orphaned resource by ArgoCD.

Additionally we have two instances of ArgoCD running in one cluster. Depending on the Namespace we see orphaned-resources which have been created by the other ArgoCD instance.

I agree with @silverraven691 that better selector capabilities would allow us to filter out resources such as custom labels / annotations.

Ultimately our aim is to use the orphaned resource finding capabilities of ArgoCD rather than having to make our own. Being able to remove some further categories of resources would be a great improvement on how we track them.