Skip to content

Commit

Permalink
feat(lb): add support for connection-rate-limit (scaleway#4512)
Browse files Browse the repository at this point in the history
Co-authored-by: Rémy Léone <rleone@scaleway.com>
  • Loading branch information
scaleway-bot and remyleone authored Feb 18, 2025
1 parent c041d7f commit 3e7b5be
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ARGS:
[timeout-client=5m] Maximum allowed inactivity time on the client side
[certificate-ids.{index}] List of SSL/TLS certificate IDs to bind to the frontend
[enable-http3] Defines whether to enable HTTP/3 protocol on the frontend
[connection-rate-limit] Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.
[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)

DEPRECATED ARGS:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ARGS:
[timeout-client=5m] Maximum allowed inactivity time on the client side
[certificate-ids.{index}] List of SSL/TLS certificate IDs to bind to the frontend
[enable-http3] Defines whether to enable HTTP/3 protocol on the frontend
[connection-rate-limit] Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.
[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)

DEPRECATED ARGS:
Expand Down
2 changes: 2 additions & 0 deletions docs/commands/lb.md
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,7 @@ scw lb frontend create [arg=value ...]
| ~~certificate-id~~ | Deprecated | Certificate ID, deprecated in favor of certificate_ids array |
| certificate-ids.{index} | | List of SSL/TLS certificate IDs to bind to the frontend |
| enable-http3 | | Defines whether to enable HTTP/3 protocol on the frontend |
| connection-rate-limit | | Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second. |
| 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 |


Expand Down Expand Up @@ -765,6 +766,7 @@ scw lb frontend update <frontend-id ...> [arg=value ...]
| ~~certificate-id~~ | Deprecated | Certificate ID, deprecated in favor of certificate_ids array |
| certificate-ids.{index} | | List of SSL/TLS certificate IDs to bind to the frontend |
| enable-http3 | | Defines whether to enable HTTP/3 protocol on the frontend |
| connection-rate-limit | | Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second. |
| 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 |


Expand Down
14 changes: 14 additions & 0 deletions internal/namespaces/lb/v1/lb_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,13 @@ func lbFrontendCreate() *core.Command {
Deprecated: false,
Positional: false,
},
{
Name: "connection-rate-limit",
Short: `Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.`,
Required: false,
Deprecated: false,
Positional: false,
},
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZoneNlAms3, scw.ZonePlWaw1, scw.ZonePlWaw2, scw.ZonePlWaw3),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
Expand Down Expand Up @@ -1831,6 +1838,13 @@ func lbFrontendUpdate() *core.Command {
Deprecated: false,
Positional: false,
},
{
Name: "connection-rate-limit",
Short: `Rate limit for new connections established on this frontend. Use 0 value to disable, else value is connections per second.`,
Required: false,
Deprecated: false,
Positional: false,
},
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZoneNlAms3, scw.ZonePlWaw1, scw.ZonePlWaw2, scw.ZonePlWaw3),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
Expand Down

0 comments on commit 3e7b5be

Please sign in to comment.