This short Go program uses a Fist-fit-decreasing Bin Packing algorithm to assign Kubernetes clusters to different Argo CD Application Controller shard based on their resources count. It bases its calculations on the output of the argocd-util cluster stats
command. The output can be used to update the undocumented shard
key of the cluster secrets.
argocd-util cluster stats --namespace=argocd | go run reshard.go