Summary
Currently, Argo CD uses a set of global environment variables (ARGOCD_K8S_CLIENT_QPS and ARGOCD_K8S_CLIENT_BURST, maps to controller.k8s.client.qps and controller.k8s.client.burst in argocd-cmd-params-cm) to configure the rate-limiting (QPS and Burst) of the Kubernetes REST clients for all managed destination clusters.
We propose introducing the ability to define cluster-specific QPS and Burst limits, allowing operators to fine-tune rate-limiting on a per-cluster basis.
Motivation
In large-scale multi-cluster environments managed by Argo CD, target clusters can vary drastically in their infrastructure capabilities, network topology, and workload density.
A "one-size-fits-all" global QPS/Burst configuration introduces several critical trade-offs:
- Under-provisioned/Edge Clusters: Small or edge clusters can easily be overwhelmed by the default QPS of
50 and Burst of 100 during sync operations or intense cache discovery. This leads to API Server throttling, elevated latencies, or even API server crashes.
- High-Performance/Scale Clusters: Large-scale enterprise clusters containing thousands of resources require high QPS/Burst limits to accelerate reconciliation, reduce Sync times, and handle rapid automatic rollouts (Auto-Sync).
- The "Lowest Common Denominator" Problem: Operators are currently forced to either set a very low global QPS (slowing down synchronization for high-performance clusters) or a high global QPS (risking the stability of weak edge clusters).
Allowing granular, per-cluster overrides would solve this bottleneck, bringing better stability to fragile clusters and higher performance to massive ones.
Proposal
I propose extending the Cluster Secret configuration to allow user to specify custom QPS and Burst values. If a Cluster Secret does not define these specific values, Argo CD will seamlessly fall back to the global defaults configured in the ConfigMap (argocd-cmd-params-cm).
To implement this on the Cluster Secret, we have identified two viable options:
Option 1: Leveraging Cluster Secret metadata.annotations (Non-intrusive metadata expansion)
This approach reads the custom limits directly from the Cluster Secret's annotations, which are already automatically deserialized into the Cluster.Annotations struct by Argo CD.
apiVersion: v1
kind: Secret
metadata:
name: edge-cluster-secret
labels:
argocd.argoproj.io/secret-type: cluster
annotations:
# Option 1: Define limits via annotations
argocd.argoproj.io/k8s-client-qps: "10"
argocd.argoproj.io/k8s-client-burst: "20"
Option 2: Extending Cluster Secret data.config JSON Schema (First-Class API Field)
This approach extends the ClusterConfig struct inside pkg/apis/application/v1alpha1/types.go by adding native typed fields. Since the Cluster Secret's data.config string is unmarshaled directly into ClusterConfig, this enables defining limits natively inside the Config JSON.
apiVersion: v1
kind: Secret
metadata:
name: edge-cluster-secret
labels:
argocd.argoproj.io/secret-type: cluster
type: Opaque
stringData:
name: edge-cluster
server: https://edge-cluster.internal
config: |
{
"bearerToken": "example-token",
// Option 2: Define limits natively inside the config payload
"qps": 10,
"burst": 20
}
Backward Compatibility & Fallback Mechanism (Crucial)
To guarantee 100% backward compatibility, both options will follow a strict fallback order during Kubernetes client initialization.
If neither Option 1 nor Option 2 is specified in the Cluster Secret, Argo CD will default to the global limits defined in argocd-cmd-params-cm (e.g., controller.k8s.client.qps and controller.k8s.client.burst).
I would love to get feedback from the maintainers on the preferred design option. I am also open to submitting a Pull Request for this feature once we align on the approach!
Summary
Currently, Argo CD uses a set of global environment variables (
ARGOCD_K8S_CLIENT_QPSandARGOCD_K8S_CLIENT_BURST, maps tocontroller.k8s.client.qpsandcontroller.k8s.client.burstinargocd-cmd-params-cm) to configure the rate-limiting (QPS and Burst) of the Kubernetes REST clients for all managed destination clusters.We propose introducing the ability to define cluster-specific QPS and Burst limits, allowing operators to fine-tune rate-limiting on a per-cluster basis.
Motivation
In large-scale multi-cluster environments managed by Argo CD, target clusters can vary drastically in their infrastructure capabilities, network topology, and workload density.
A "one-size-fits-all" global QPS/Burst configuration introduces several critical trade-offs:
50and Burst of100during sync operations or intense cache discovery. This leads to API Server throttling, elevated latencies, or even API server crashes.Allowing granular, per-cluster overrides would solve this bottleneck, bringing better stability to fragile clusters and higher performance to massive ones.
Proposal
I propose extending the Cluster Secret configuration to allow user to specify custom QPS and Burst values. If a Cluster Secret does not define these specific values, Argo CD will seamlessly fall back to the global defaults configured in the ConfigMap (argocd-cmd-params-cm).
To implement this on the Cluster Secret, we have identified two viable options:
Option 1: Leveraging Cluster Secret metadata.annotations (Non-intrusive metadata expansion)
This approach reads the custom limits directly from the Cluster Secret's annotations, which are already automatically deserialized into the Cluster.Annotations struct by Argo CD.
Option 2: Extending Cluster Secret data.config JSON Schema (First-Class API Field)
This approach extends the ClusterConfig struct inside pkg/apis/application/v1alpha1/types.go by adding native typed fields. Since the Cluster Secret's data.config string is unmarshaled directly into ClusterConfig, this enables defining limits natively inside the Config JSON.
Backward Compatibility & Fallback Mechanism (Crucial)
To guarantee 100% backward compatibility, both options will follow a strict fallback order during Kubernetes client initialization.
If neither Option 1 nor Option 2 is specified in the Cluster Secret, Argo CD will default to the global limits defined in argocd-cmd-params-cm (e.g., controller.k8s.client.qps and controller.k8s.client.burst).
I would love to get feedback from the maintainers on the preferred design option. I am also open to submitting a Pull Request for this feature once we align on the approach!