Skip to content

Commit 3e7b5be

Browse files
feat(lb): add support for connection-rate-limit (#4512)
Co-authored-by: Rémy Léone <[email protected]>
1 parent c041d7f commit 3e7b5be

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

cmd/scw/testdata/test-all-usage-lb-frontend-create-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ARGS:
1313
[timeout-client=5m] Maximum allowed inactivity time on the client side
1414
[certificate-ids.{index}] List of SSL/TLS certificate IDs to bind to the frontend
1515
[enable-http3] Defines whether to enable HTTP/3 protocol on the frontend
16+
[connection-rate-limit] Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.
1617
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)
1718

1819
DEPRECATED ARGS:

cmd/scw/testdata/test-all-usage-lb-frontend-update-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ARGS:
1313
[timeout-client=5m] Maximum allowed inactivity time on the client side
1414
[certificate-ids.{index}] List of SSL/TLS certificate IDs to bind to the frontend
1515
[enable-http3] Defines whether to enable HTTP/3 protocol on the frontend
16+
[connection-rate-limit] Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.
1617
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)
1718

1819
DEPRECATED ARGS:

docs/commands/lb.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,7 @@ scw lb frontend create [arg=value ...]
676676
| ~~certificate-id~~ | Deprecated | Certificate ID, deprecated in favor of certificate_ids array |
677677
| certificate-ids.{index} | | List of SSL/TLS certificate IDs to bind to the frontend |
678678
| enable-http3 | | Defines whether to enable HTTP/3 protocol on the frontend |
679+
| connection-rate-limit | | Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second. |
679680
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `nl-ams-3`, `pl-waw-1`, `pl-waw-2`, `pl-waw-3` | Zone to target. If none is passed will use default zone from the config |
680681

681682

@@ -765,6 +766,7 @@ scw lb frontend update <frontend-id ...> [arg=value ...]
765766
| ~~certificate-id~~ | Deprecated | Certificate ID, deprecated in favor of certificate_ids array |
766767
| certificate-ids.{index} | | List of SSL/TLS certificate IDs to bind to the frontend |
767768
| enable-http3 | | Defines whether to enable HTTP/3 protocol on the frontend |
769+
| connection-rate-limit | | Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second. |
768770
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `nl-ams-3`, `pl-waw-1`, `pl-waw-2`, `pl-waw-3` | Zone to target. If none is passed will use default zone from the config |
769771

770772

internal/namespaces/lb/v1/lb_cli.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,6 +1721,13 @@ func lbFrontendCreate() *core.Command {
17211721
Deprecated: false,
17221722
Positional: false,
17231723
},
1724+
{
1725+
Name: "connection-rate-limit",
1726+
Short: `Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.`,
1727+
Required: false,
1728+
Deprecated: false,
1729+
Positional: false,
1730+
},
17241731
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZoneNlAms3, scw.ZonePlWaw1, scw.ZonePlWaw2, scw.ZonePlWaw3),
17251732
},
17261733
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
@@ -1831,6 +1838,13 @@ func lbFrontendUpdate() *core.Command {
18311838
Deprecated: false,
18321839
Positional: false,
18331840
},
1841+
{
1842+
Name: "connection-rate-limit",
1843+
Short: `Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.`,
1844+
Required: false,
1845+
Deprecated: false,
1846+
Positional: false,
1847+
},
18341848
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZoneNlAms3, scw.ZonePlWaw1, scw.ZonePlWaw2, scw.ZonePlWaw3),
18351849
},
18361850
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {

0 commit comments

Comments
 (0)