fix: Increase discovery config burst rate#349
fix: Increase discovery config burst rate#349mgruener wants to merge 1 commit intoargoproj:masterfrom
Conversation
e91fc11 to
73f976d
Compare
Avoid client side throttling for clusters with lots of CRDs. Signed-off-by: Michael Gruener <michael.gruener@chaosmoon.net>
73f976d to
439822e
Compare
|
Kudos, SonarCloud Quality Gate passed!
|
|
Hi @mgruener, It should be possible to set this already using Also it seems that documentation for this feature is still lacking. But there is argoproj/argo-cd#8527 which aims to improve this and which also shows what other options are available to configure |
|
Hi @sreber84, if nothing has fundamentally changed since I opened this PR, the env var you mentioned only affects the k8s client used by ArgoCD to access its host cluster to interact with its CRs (Applications, AppProjects ...). The value of ARGOCD_K8S_CLIENT_BURST is not passed to the gitops-engine code, which has its own k8s client factory to create k8s clients based on the cluster secrets. These k8s clients are then used to apply the actual managed k8s resources to the target clusters. This PR targets the k8s clients used by the gitops-engine (ok, this is probably obvious given the PR is in the gitops-engine repo :D). |
I guess there has been something changed, because there was a bug with evaluating those specific environment variables, which has been fixed with argoproj/argo-cd#7779 on Nov 25th, and this fix was released with v2.1.8 and v2.2.0. So effectively, the environment variables had no effect prior to this.
This is not completely correct. gitops-engine receives a REST client configuration from Argo CD for performing operations on the cluster. Can you please test again with ARGOCD_K8S_CLIENT_BURST (and possibly, ARGOCD_K8S_CLIENT_QPS) set to an appropriate value? |
|
OK, so in another discussion with someone who had a similar issue, we found out that the burst and QPS settings are indeed not passed to the discovery client. The reason for this is that we still pass the REST configuration that we used for writing out a kubeconfig to the sync context here gitops-engine/pkg/sync/sync_context.go Line 205 in 61c0cc7 @alexmt Can you please verify? Would it make more sense to pass |
|
@jannfis thanks for bringing this up. |
|
@jannfis absolutely. If the issue is fixed in the end I am happy 😄Having it configurable is the better solution anyway. Closing. |








This change increases the api call burst rate for the discovery client config.
On clusters with lots of CRDs (which is way more common these days), the default discovery burst rate of 100 is not enough, leading to massive slowdowns during sync operations because the client side rate-limiter kicks in (indicated by lots of "Waited for X.XXs due to client-side throttling, not priority and fairness").
During my tests with our OpenShift clusters (which have a lot of CRDs by default; our current setup has ~250), the creation of 100 ConfigMaps took 4:03 minutes (tested multiple times with different sync settings) without this change. After implementing this change, the time went down to 5 seconds.
In its own "oc" Kubernetes client for OpenShift, Redhat uses a burst rate of 250 (see https://bugzilla.redhat.com/show_bug.cgi?id=1899575) but in our experience, even this is not enough. Hence the value of 350 in this PR.