Skip to content
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

Increase default rate limit of antrea-controller #6231

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions cmd/antrea-controller/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ import (
)

const (
// Use higher QPS and Burst rather than the default settings (QPS: 5, Burst: 10), otherwise synchronizing resources
// like ClusterNetworkPolicies and Egresses would be rather slow when they are created in bulk.
// The following values are recommended by RecommendedDefaultClientConnectionConfiguration.
// https://github.com/kubernetes/kubernetes/blob/b722d017a34b300a2284b890448e5a605f21d01e/staging/src/k8s.io/component-base/config/v1alpha1/defaults.go#L65-L75
defaultClientQPS = 50
defaultClientBurst = 100

ipamIPv4MaskLo = 16
ipamIPv4MaskHi = 30
ipamIPv4MaskDefault = 24
Expand Down Expand Up @@ -194,6 +201,12 @@ func (o *Options) setDefaults() {
if o.config.IPsecCSRSignerConfig.AutoApprove == nil {
o.config.IPsecCSRSignerConfig.AutoApprove = ptrBool(true)
}
if o.config.ClientConnection.QPS == 0.0 {
o.config.ClientConnection.QPS = defaultClientQPS
}
if o.config.ClientConnection.Burst == 0 {
o.config.ClientConnection.Burst = defaultClientBurst
}
}

func ptrBool(value bool) *bool {
Expand Down
2 changes: 2 additions & 0 deletions cmd/antrea-controller/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ func TestNewOptions(t *testing.T) {
assert.Equal(t, ipamIPv6MaskDefault, op.config.NodeIPAM.NodeCIDRMaskSizeIPv6)
assert.Equal(t, true, *op.config.IPsecCSRSignerConfig.SelfSignedCA)
assert.Equal(t, true, *op.config.IPsecCSRSignerConfig.AutoApprove)
assert.EqualValues(t, defaultClientQPS, op.config.ClientConnection.QPS)
assert.EqualValues(t, defaultClientBurst, op.config.ClientConnection.Burst)
}

func TestValidateNodeIPAMControllerOptions(t *testing.T) {
Expand Down
Loading