Skip to content

Commit

Permalink
feat(serverless): add health check spec to containers (#4249)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored Oct 31, 2024
1 parent e8adef0 commit 81af366
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ ARGS:
[local-storage-limit] Local storage limit of the container (in MB)
[scaling-option.concurrent-requests-threshold]
[scaling-option.cpu-usage-threshold]
[health-check.http.path] Path to use for the HTTP health check.
[health-check.failure-threshold] Number of consecutive health check failures before considering the container unhealthy.
[health-check.interval] Period between health checks.
[deploy=true] Deploy container after creation
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ ARGS:
[local-storage-limit] Local storage limit of the container (in MB)
[scaling-option.concurrent-requests-threshold]
[scaling-option.cpu-usage-threshold]
[health-check.http.path] Path to use for the HTTP health check.
[health-check.failure-threshold] Number of consecutive health check failures before considering the container unhealthy.
[health-check.interval] Period between health checks.
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

DEPRECATED ARGS:
Expand Down
6 changes: 6 additions & 0 deletions docs/commands/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ scw container container create [arg=value ...]
| local-storage-limit | | Local storage limit of the container (in MB) |
| scaling-option.concurrent-requests-threshold | | |
| scaling-option.cpu-usage-threshold | | |
| health-check.http.path | | Path to use for the HTTP health check. |
| health-check.failure-threshold | | Number of consecutive health check failures before considering the container unhealthy. |
| health-check.interval | | Period between health checks. |
| deploy | Default: `true` | Deploy container after creation |
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |

Expand Down Expand Up @@ -206,6 +209,9 @@ scw container container update <container-id ...> [arg=value ...]
| local-storage-limit | | Local storage limit of the container (in MB) |
| scaling-option.concurrent-requests-threshold | | |
| scaling-option.cpu-usage-threshold | | |
| health-check.http.path | | Path to use for the HTTP health check. |
| health-check.failure-threshold | | Number of consecutive health check failures before considering the container unhealthy. |
| health-check.interval | | Period between health checks. |
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |


Expand Down
42 changes: 42 additions & 0 deletions internal/namespaces/container/v1beta1/container_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,27 @@ func containerContainerCreate() *core.Command {
Deprecated: false,
Positional: false,
},
{
Name: "health-check.http.path",
Short: `Path to use for the HTTP health check.`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "health-check.failure-threshold",
Short: `Number of consecutive health check failures before considering the container unhealthy.`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "health-check.interval",
Short: `Period between health checks.`,
Required: false,
Deprecated: false,
Positional: false,
},
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
Expand Down Expand Up @@ -792,6 +813,27 @@ func containerContainerUpdate() *core.Command {
Deprecated: false,
Positional: false,
},
{
Name: "health-check.http.path",
Short: `Path to use for the HTTP health check.`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "health-check.failure-threshold",
Short: `Number of consecutive health check failures before considering the container unhealthy.`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "health-check.interval",
Short: `Period between health checks.`,
Required: false,
Deprecated: false,
Positional: false,
},
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
Expand Down

0 comments on commit 81af366

Please sign in to comment.