From cab85c7dae0f885e330e6452b267b122a56bd318 Mon Sep 17 00:00:00 2001 From: Tarun Chinmai Sekar <70169773+tchinmai7@users.noreply.github.com> Date: Wed, 13 Mar 2024 20:08:02 -0700 Subject: [PATCH] disable conn-throttle by default (#189) * disable conn-throttle by default * set to 0 only if nothing is specified: * update readmne --- README.md | 2 +- cloud/linode/loadbalancers.go | 2 +- cloud/linode/loadbalancers_test.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b18e4dcb..1c91de39 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Each *Service* annotation **MUST** be prefixed with:
Annotation (Suffix) | Values | Default | Description ---|---|---|--- -`throttle` | `0`-`20` (`0` to disable) | `20` | Client Connection Throttle, which limits the number of subsequent new connections per second from the same client IP +`throttle` | `0`-`20` (`0` to disable) | `0` | Client Connection Throttle, which limits the number of subsequent new connections per second from the same client IP `default-protocol` | `tcp`, `http`, `https` | `tcp` | This annotation is used to specify the default protocol for Linode NodeBalancer. `default-proxy-protocol` | `none`, `v1`, `v2` | `none` | Specifies whether to use a version of Proxy Protocol on the underlying NodeBalancer. `port-*` | json (e.g. `{ "tls-secret-name": "prod-app-tls", "protocol": "https", "proxy-protocol": "v2"}`) | | Specifies port specific NodeBalancer configuration. See [Port Specific Configuration](#port-specific-configuration). `*` is the port being configured, e.g. `linode-loadbalancer-port-443` diff --git a/cloud/linode/loadbalancers.go b/cloud/linode/loadbalancers.go index a661c60e..dd989b76 100644 --- a/cloud/linode/loadbalancers.go +++ b/cloud/linode/loadbalancers.go @@ -825,7 +825,7 @@ func getTLSCertInfo(ctx context.Context, kubeClient kubernetes.Interface, namesp } func getConnectionThrottle(service *v1.Service) int { - connThrottle := 20 + connThrottle := 0 // disable throttle if nothing is specified if connThrottleString := service.GetAnnotations()[annotations.AnnLinodeThrottle]; connThrottleString != "" { parsed, err := strconv.Atoi(connThrottleString) diff --git a/cloud/linode/loadbalancers_test.go b/cloud/linode/loadbalancers_test.go index f944bc40..c3222f73 100644 --- a/cloud/linode/loadbalancers_test.go +++ b/cloud/linode/loadbalancers_test.go @@ -1818,7 +1818,7 @@ func Test_getConnectionThrottle(t *testing.T) { Annotations: map[string]string{}, }, }, - 20, + 0, }, { "throttle value is a string", @@ -1831,7 +1831,7 @@ func Test_getConnectionThrottle(t *testing.T) { }, }, }, - 20, + 0, }, { "throttle value is less than 0",