Skip to content

Commit

Permalink
disable conn-throttle by default (#189)
Browse files Browse the repository at this point in the history
* disable conn-throttle by default

* set to 0 only if nothing is specified:

* update readmne
  • Loading branch information
tchinmai7 authored Mar 14, 2024
1 parent acb82b8 commit cab85c7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Each *Service* annotation **MUST** be prefixed with:<br />

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`
Expand Down
2 changes: 1 addition & 1 deletion cloud/linode/loadbalancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions cloud/linode/loadbalancers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,7 @@ func Test_getConnectionThrottle(t *testing.T) {
Annotations: map[string]string{},
},
},
20,
0,
},
{
"throttle value is a string",
Expand All @@ -1831,7 +1831,7 @@ func Test_getConnectionThrottle(t *testing.T) {
},
},
},
20,
0,
},
{
"throttle value is less than 0",
Expand Down

0 comments on commit cab85c7

Please sign in to comment.