-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Introduce Namespace Selectors to Control Which Namespaces Argo CD Monitors for Changes #21835
Comments
We would also maybe want to consider supporting matchLabels and matchExpressions as well from the standard k8s type of |
Yep, I am using that already in the PoC PR - https://github.com/argoproj/argo-cd/pull/21846/files#diff-1637a10eecce380802dc8c0a10ac6870c8afeabb4fa679845a21341fcd80faf9R427 |
Hi @nebojsa-prodana, we discussed about your proposal in today's contributors meeting. I'd like to understand a bit better what your main goal is. What is your main concern with Argo CD keeping track of all cluster resources? Performance, security, something else? |
Hi @leoluz
Right now, the primary concern is performance and improved security from ArgoCD not having access to cluster-level resources is a bonus. Our security teams are aware of ArgoCD being overprivileged though, and there is work planned to harden our ArgoCD instances. Regarding performance: This ArgoCD instance really does not need to monitor cluster-resources. It is dedicated to deploying user workloads to specific namespaces. We worked around this by using resource.inclusions and resource.exclusions to limit what is being monitored. Ignoring cluster-level resources alone helped significantly However, as mentioned in the motivation section, in our setup we cannot easily specify which namespaces should be monitored in the cluster secrets as the users are enabled to create their own namespaces: This is with We also had to exclude pods from being tracked by ArgoCD as it was causing ArgoCD to slow down to crawl given that some services are running with hundreds of pods. We are planning to upgrade to v2.14 soon which will enable us to ignore dependent resources. The above screenshots were taken on ArgoCD v2.12.4+27d1e64. |
Summary
Extend Argo CD’s cluster secrets to allow namespace selection using a label selector.
This would enable dynamic filtering of namespaces instead of maintaining a static list.
Motivation
We are in the process of moving our workloads to be deployed through ArgoCD and would like to be able to monitor only the namespaces that have adopted ArgoCD.
In environments with multiple Argo CD instances, such as:
Currently, Workload Argo CD observes all events cluster-wide by default, including those unrelated to user applications.
We are already making use of resource.exclusions to filter out CRDs that do not constitute user workloads, but we'd also like to limit the namespaces where monitoring occurs.
For instance, we would want to avoid observing deployments or pods events of a large workload (300+ pods) that still has to be onboarded to ArgoCD.
Furthermore, different clusters have different namespaces provisioned. Maintaining the list of provisioned namespaces for each cluster secret could be quite a chore.
Proposal
Introduce a
namespaceSelector
field in the cluster secret, which would function as an alternative to the existing namespaces list (mutually exclusive).This would allow us to:
This enhancement would streamline namespace management in large-scale deployments and improve Argo CD’s reconciliation efficiency.
The text was updated successfully, but these errors were encountered: