Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(serverless): add health check spec to containers #4249

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading