Skip to content

Commit 81af366

Browse files
authored
feat(serverless): add health check spec to containers (#4249)
1 parent e8adef0 commit 81af366

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed

cmd/scw/testdata/test-all-usage-container-container-create-usage.golden

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ ARGS:
2626
[local-storage-limit] Local storage limit of the container (in MB)
2727
[scaling-option.concurrent-requests-threshold]
2828
[scaling-option.cpu-usage-threshold]
29+
[health-check.http.path] Path to use for the HTTP health check.
30+
[health-check.failure-threshold] Number of consecutive health check failures before considering the container unhealthy.
31+
[health-check.interval] Period between health checks.
2932
[deploy=true] Deploy container after creation
3033
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
3134

cmd/scw/testdata/test-all-usage-container-container-update-usage.golden

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ ARGS:
2626
[local-storage-limit] Local storage limit of the container (in MB)
2727
[scaling-option.concurrent-requests-threshold]
2828
[scaling-option.cpu-usage-threshold]
29+
[health-check.http.path] Path to use for the HTTP health check.
30+
[health-check.failure-threshold] Number of consecutive health check failures before considering the container unhealthy.
31+
[health-check.interval] Period between health checks.
2932
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
3033

3134
DEPRECATED ARGS:

docs/commands/container.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ scw container container create [arg=value ...]
8181
| local-storage-limit | | Local storage limit of the container (in MB) |
8282
| scaling-option.concurrent-requests-threshold | | |
8383
| scaling-option.cpu-usage-threshold | | |
84+
| health-check.http.path | | Path to use for the HTTP health check. |
85+
| health-check.failure-threshold | | Number of consecutive health check failures before considering the container unhealthy. |
86+
| health-check.interval | | Period between health checks. |
8487
| deploy | Default: `true` | Deploy container after creation |
8588
| 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 |
8689

@@ -206,6 +209,9 @@ scw container container update <container-id ...> [arg=value ...]
206209
| local-storage-limit | | Local storage limit of the container (in MB) |
207210
| scaling-option.concurrent-requests-threshold | | |
208211
| scaling-option.cpu-usage-threshold | | |
212+
| health-check.http.path | | Path to use for the HTTP health check. |
213+
| health-check.failure-threshold | | Number of consecutive health check failures before considering the container unhealthy. |
214+
| health-check.interval | | Period between health checks. |
209215
| 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 |
210216

211217

internal/namespaces/container/v1beta1/container_cli.go

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,27 @@ func containerContainerCreate() *core.Command {
624624
Deprecated: false,
625625
Positional: false,
626626
},
627+
{
628+
Name: "health-check.http.path",
629+
Short: `Path to use for the HTTP health check.`,
630+
Required: false,
631+
Deprecated: false,
632+
Positional: false,
633+
},
634+
{
635+
Name: "health-check.failure-threshold",
636+
Short: `Number of consecutive health check failures before considering the container unhealthy.`,
637+
Required: false,
638+
Deprecated: false,
639+
Positional: false,
640+
},
641+
{
642+
Name: "health-check.interval",
643+
Short: `Period between health checks.`,
644+
Required: false,
645+
Deprecated: false,
646+
Positional: false,
647+
},
627648
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw),
628649
},
629650
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
@@ -792,6 +813,27 @@ func containerContainerUpdate() *core.Command {
792813
Deprecated: false,
793814
Positional: false,
794815
},
816+
{
817+
Name: "health-check.http.path",
818+
Short: `Path to use for the HTTP health check.`,
819+
Required: false,
820+
Deprecated: false,
821+
Positional: false,
822+
},
823+
{
824+
Name: "health-check.failure-threshold",
825+
Short: `Number of consecutive health check failures before considering the container unhealthy.`,
826+
Required: false,
827+
Deprecated: false,
828+
Positional: false,
829+
},
830+
{
831+
Name: "health-check.interval",
832+
Short: `Period between health checks.`,
833+
Required: false,
834+
Deprecated: false,
835+
Positional: false,
836+
},
795837
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw),
796838
},
797839
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {

0 commit comments

Comments
 (0)