Open Ezzahhh opened 6 months ago
Additionally would also like to add an interesting behaviour when we have duplicated server URLs:
If you have any AppSets that target these, then you will obviously get issues with the Apps that are generated conflicting against one another and complaining about being owned by another App.
Wouldn't a better solution be for the application controller to only manage apps that have the cluster name they are supposed to manage instead of managing all apps that have the same cluster uri?
This would potentially make it possible to load balance the same cluster on multiple controllers, your solution makes that impossible without once again modifying the algorithm.
Yes I believe if the application controllers only managed Applications by cluster name instead, it would also solve this problem.
I don't yet understand the inner workings of Argo enough to know the implications and what needs to change to get this done - such as performance implications for having multiple controllers setting up Kubernetes watch APIs to the same physical cluster or how caching may be affected.
I'm more than happy to take more feedback or pointers about solving this issue.
Checklist:
argocd version
.Describe the bug
There are use cases where using AppSets we may want to create multiple cluster secrets with different
name
but the sameserver
, such as GitOps bridge concept of passing labels and annotations into the App/AppSet but the workload may happen to be in the same cluster but just in a different namespace.Both
legacy
andround-robin
sharding algorithms take the Cluster secret ID to calculate the shard. This means that if two secrets "a" and "b" both haveserver: https://api.master-node.com
they could conceivably resolve different shard values which means more than one controller will try to sync the same physical cluster.The solution should be to shard on the
server
instead of the ID as it cannot be assumed that the ID represents a unique physical cluster but the server can be.My workaround: manually set
shard
in the cluster secrets for all that have the sameserver
To Reproduce
Create 10 secrets (or any arbitrary number greater than 2) with different names but the same
server
. Enable sharding on either algorithm and check metricssum(argocd_cluster_info) by (pod, server)
You will observe that at least two controllers will report that they manage the same server URL. Subsequently,sum(argocd_app_info{})
will show an elevated number as controllers are syncing all Applications belonging to those clusters.Expected behavior
Duplicate cluster secrets with the same
server
should resolve to the same shard instead of by an arbitrary ID entry that incorrectly assumes uniqueness by each entry.Screenshots
Version