Skip to content

Commit a8498ce

Browse files
authored
healthcheck (#254)
1 parent 2a63ea5 commit a8498ce

File tree

3 files changed

+161
-24
lines changed

3 files changed

+161
-24
lines changed

apps/docs/content/zerops-yaml/specification.mdx

Lines changed: 63 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,51 @@ Defines a health check for your application.
376376
```yaml
377377
run:
378378
healthCheck:
379+
# HTTP GET method example
379380
httpGet:
380381
port: 80
381382
path: /status
383+
host: my-host.zerops
384+
scheme: https
385+
# OR command-based example
386+
exec:
387+
command: |
388+
curl -s http://localhost:8080/status > /tmp/status
389+
grep -q "OK" /tmp/status
390+
391+
# Common parameters
392+
failureTimeout: 60
393+
disconnectTimeout: 30
394+
recoveryTimeout: 30
395+
execPeriod: 10
382396
```
383397

398+
Available parameters:
399+
400+
#### httpGet <Badge type="optional" />
401+
Configures the health check to request a local URL using a HTTP GET method.
402+
403+
- **port** <Badge type="required" /> - Defines the port of the HTTP GET request.
404+
- **path** <Badge type="required" /> - Defines the URL path of the HTTP GET request.
405+
- **host** <Badge type="optional" /> - The health check is triggered from inside of your runtime container so it uses the localhost (127.0.0.1). If you need to add a host to the request header, specify it in the host attribute.
406+
- **scheme** <Badge type="optional" /> - The health check is triggered from inside of your runtime container so no https is required. If your application requires a https request, set scheme: `https`.
407+
408+
#### exec <Badge type="optional" />
409+
Configures the health check to run a local command.
410+
411+
- **command** <Badge type="required" /> - Defines a local command to be run. The command has access to the same environment variables. A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example above.
412+
413+
#### Common parameters <Badge type="optional" />
414+
The following parameters can be used with either `httpGet` or `exec` health checks:
415+
- **failureTimeout** - Time in seconds until container fails after consecutive health check failures (reset by success).
416+
- **disconnectTimeout** - Time in seconds until container is disconnected and becomes publicly unavailable.
417+
- **recoveryTimeout** - Time in seconds until container is connected and becomes publicly available.
418+
- **execPeriod** - Time interval in seconds between health check attempts.
419+
420+
:::tip
421+
Health checks continuously monitor your running application, while readiness checks verify if a new deployment is ready to receive traffic. For readiness checks, see the [readinessCheck section](#readinesscheck-).
422+
:::
423+
384424
### crontab <Badge type="optional" />
385425

386426
Defines scheduled commands to run as cron jobs within a service.
@@ -398,25 +438,40 @@ Setup cron jobs. See [examples](/references/cron).
398438

399439
### readinessCheck <Badge type="optional" />
400440

401-
Defines a readiness check for your application. (See [readiness checks](/features/pipeline#readiness-checks))
441+
Defines a readiness check for your application. Requires either `httpGet` object or `exec` object.
402442

403443
```yaml
404444
deploy:
405445
readinessCheck:
446+
# HTTP GET method example
406447
httpGet:
407448
port: 80
408449
path: /status
409-
host: 127.0.0.1
450+
host: my-host.zerops
410451
scheme: https
411452
412-
# Or use commands
413-
exec:
414-
command: |
415-
touch grass
416-
rm -rf life
417-
mv /outside/user /home/user
453+
# Common parameters
454+
failureTimeout: 60
455+
retryPeriod: 10
418456
```
419457

458+
Readiness checks work similarly to [health checks](#healthcheck-) but are specifically for deployment. They verify if a new deployment is ready to receive traffic.
459+
460+
Available parameters:
461+
462+
#### httpGet and exec
463+
The `httpGet` and `exec` options work the same way as in [health checks](#healthcheck-). See that section for detailed parameter descriptions.
464+
465+
#### Common parameters <Badge type="optional" />
466+
The following parameters can be used with either `httpGet` or `exec` readiness checks:
467+
468+
- **failureTimeout** - Time in seconds until container is marked as failed.
469+
- **retryPeriod** - Time interval in seconds between readiness check attempts (equivalent to `execPeriod` in health checks).
470+
471+
:::tip
472+
Unlike health checks which run continuously, readiness checks only run during deployments to determine when your application is ready to accept traffic.
473+
:::
474+
420475
:::note
421476
For more detailed information on specific configurations, refer to the runtime-specific guides linked at the beginning of this document.
422477
:::

apps/docs/static/llms-full.txt

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31790,10 +31790,42 @@ Defines a health check for your application.
3179031790
```yaml
3179131791
run:
3179231792
healthCheck:
31793+
# HTTP GET method example
3179331794
httpGet:
3179431795
port: 80
3179531796
path: /status
31797+
host: my-host.zerops
31798+
scheme: https
31799+
# OR command-based example
31800+
exec:
31801+
command: |
31802+
curl -s http://localhost:8080/status > /tmp/status
31803+
grep -q "OK" /tmp/status
31804+
# Common parameters
31805+
failureTimeout: 60
31806+
disconnectTimeout: 30
31807+
recoveryTimeout: 30
31808+
execPeriod: 10
3179631809
```
31810+
Available parameters:
31811+
#### httpGet
31812+
Configures the health check to request a local URL using a HTTP GET method.
31813+
- **port** - Defines the port of the HTTP GET request.
31814+
- **path** - Defines the URL path of the HTTP GET request.
31815+
- **host** - The health check is triggered from inside of your runtime container so it uses the localhost (127.0.0.1). If you need to add a host to the request header, specify it in the host attribute.
31816+
- **scheme** - The health check is triggered from inside of your runtime container so no https is required. If your application requires a https request, set scheme: `https`.
31817+
#### exec
31818+
Configures the health check to run a local command.
31819+
- **command** - Defines a local command to be run. The command has access to the same environment variables. A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example above.
31820+
#### Common parameters
31821+
The following parameters can be used with either `httpGet` or `exec` health checks:
31822+
- **failureTimeout** - Time in seconds until container fails after consecutive health check failures (reset by success).
31823+
- **disconnectTimeout** - Time in seconds until container is disconnected and becomes publicly unavailable.
31824+
- **recoveryTimeout** - Time in seconds until container is connected and becomes publicly available.
31825+
- **execPeriod** - Time interval in seconds between health check attempts.
31826+
:::tip
31827+
Health checks continuously monitor your running application, while readiness checks verify if a new deployment is ready to receive traffic. For readiness checks, see the [readinessCheck section](#readinesscheck-).
31828+
:::
3179731829
### crontab
3179831830
Defines scheduled commands to run as cron jobs within a service.
3179931831
```yaml
@@ -31805,22 +31837,31 @@ run:
3180531837
Setup cron jobs. See [examples](/references/cron).
3180631838
## Deploy Configuration
3180731839
### readinessCheck
31808-
Defines a readiness check for your application. (See [readiness checks](/features/pipeline#readiness-checks))
31840+
Defines a readiness check for your application. Requires either `httpGet` object or `exec` object.
3180931841
```yaml
3181031842
deploy:
3181131843
readinessCheck:
31844+
# HTTP GET method example
3181231845
httpGet:
3181331846
port: 80
3181431847
path: /status
31815-
host: 127.0.0.1
31848+
host: my-host.zerops
3181631849
scheme: https
31817-
# Or use commands
31818-
exec:
31819-
command: |
31820-
touch grass
31821-
rm -rf life
31822-
mv /outside/user /home/user
31850+
# Common parameters
31851+
failureTimeout: 60
31852+
retryPeriod: 10
3182331853
```
31854+
Readiness checks work similarly to [health checks](#healthcheck-) but are specifically for deployment. They verify if a new deployment is ready to receive traffic.
31855+
Available parameters:
31856+
#### httpGet and exec
31857+
The `httpGet` and `exec` options work the same way as in [health checks](#healthcheck-). See that section for detailed parameter descriptions.
31858+
#### Common parameters
31859+
The following parameters can be used with either `httpGet` or `exec` readiness checks:
31860+
- **failureTimeout** - Time in seconds until container is marked as failed.
31861+
- **retryPeriod** - Time interval in seconds between readiness check attempts (equivalent to `execPeriod` in health checks).
31862+
:::tip
31863+
Unlike health checks which run continuously, readiness checks only run during deployments to determine when your application is ready to accept traffic.
31864+
:::
3182431865
:::note
3182531866
For more detailed information on specific configurations, refer to the runtime-specific guides linked at the beginning of this document.
3182631867
:::

apps/docs/static/llms-small.txt

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28382,10 +28382,42 @@ Defines a health check for your application.
2838228382
```yaml
2838328383
run:
2838428384
healthCheck:
28385+
# HTTP GET method example
2838528386
httpGet:
2838628387
port: 80
2838728388
path: /status
28389+
host: my-host.zerops
28390+
scheme: https
28391+
# OR command-based example
28392+
exec:
28393+
command: |
28394+
curl -s http://localhost:8080/status > /tmp/status
28395+
grep -q "OK" /tmp/status
28396+
# Common parameters
28397+
failureTimeout: 60
28398+
disconnectTimeout: 30
28399+
recoveryTimeout: 30
28400+
execPeriod: 10
2838828401
```
28402+
Available parameters:
28403+
#### httpGet
28404+
Configures the health check to request a local URL using a HTTP GET method.
28405+
- **port** - Defines the port of the HTTP GET request.
28406+
- **path** - Defines the URL path of the HTTP GET request.
28407+
- **host** - The health check is triggered from inside of your runtime container so it uses the localhost (127.0.0.1). If you need to add a host to the request header, specify it in the host attribute.
28408+
- **scheme** - The health check is triggered from inside of your runtime container so no https is required. If your application requires a https request, set scheme: `https`.
28409+
#### exec
28410+
Configures the health check to run a local command.
28411+
- **command** - Defines a local command to be run. The command has access to the same environment variables. A single string is required. If you need to run multiple commands create a shell script or, use a multiline format as in the example above.
28412+
#### Common parameters
28413+
The following parameters can be used with either `httpGet` or `exec` health checks:
28414+
- **failureTimeout** - Time in seconds until container fails after consecutive health check failures (reset by success).
28415+
- **disconnectTimeout** - Time in seconds until container is disconnected and becomes publicly unavailable.
28416+
- **recoveryTimeout** - Time in seconds until container is connected and becomes publicly available.
28417+
- **execPeriod** - Time interval in seconds between health check attempts.
28418+
:::tip
28419+
Health checks continuously monitor your running application, while readiness checks verify if a new deployment is ready to receive traffic. For readiness checks, see the [readinessCheck section](#readinesscheck-).
28420+
:::
2838928421
### crontab
2839028422
Defines scheduled commands to run as cron jobs within a service.
2839128423
```yaml
@@ -28397,22 +28429,31 @@ run:
2839728429
Setup cron jobs. See [examples](/references/cron).
2839828430
## Deploy Configuration
2839928431
### readinessCheck
28400-
Defines a readiness check for your application. (See [readiness checks](/features/pipeline#readiness-checks))
28432+
Defines a readiness check for your application. Requires either `httpGet` object or `exec` object.
2840128433
```yaml
2840228434
deploy:
2840328435
readinessCheck:
28436+
# HTTP GET method example
2840428437
httpGet:
2840528438
port: 80
2840628439
path: /status
28407-
host: 127.0.0.1
28440+
host: my-host.zerops
2840828441
scheme: https
28409-
# Or use commands
28410-
exec:
28411-
command: |
28412-
touch grass
28413-
rm -rf life
28414-
mv /outside/user /home/user
28442+
# Common parameters
28443+
failureTimeout: 60
28444+
retryPeriod: 10
2841528445
```
28446+
Readiness checks work similarly to [health checks](#healthcheck-) but are specifically for deployment. They verify if a new deployment is ready to receive traffic.
28447+
Available parameters:
28448+
#### httpGet and exec
28449+
The `httpGet` and `exec` options work the same way as in [health checks](#healthcheck-). See that section for detailed parameter descriptions.
28450+
#### Common parameters
28451+
The following parameters can be used with either `httpGet` or `exec` readiness checks:
28452+
- **failureTimeout** - Time in seconds until container is marked as failed.
28453+
- **retryPeriod** - Time interval in seconds between readiness check attempts (equivalent to `execPeriod` in health checks).
28454+
:::tip
28455+
Unlike health checks which run continuously, readiness checks only run during deployments to determine when your application is ready to accept traffic.
28456+
:::
2841628457
:::note
2841728458
For more detailed information on specific configurations, refer to the runtime-specific guides linked at the beginning of this document.
2841828459
:::

0 commit comments

Comments
 (0)