Parametrized healthcheck parameters.

This commit is contained in:
slawek committed 2026-10-20 10:33:17 +02:00
1 parent 1d4ca3da46
commit 29203a7aeb
2 files changed
+16 -6

No files matched your search

+11 -1
View File
@@ -108,7 +108,7 @@ The containers run with the following settings:
| | Environment | `GOOGLE_APPLICATION_CREDENTIALS=/etc/sts-agent/cred.json` |
| | Environment | `GOOGLE_API_CERTIFICATE_CONFIG=/etc/sts-agent/certificate_config.json` |
| | Environment | `PROJECT_ID`, `PROJECT_NUMBER` |
| | Health check | `/imds-emulator -check` every 10 seconds |
| | Health check | `/imds-emulator -check`, with the timing set in `sts-agent/.env` |
| | Restart policy | `unless-stopped` |
| | Stop grace period | 30 seconds |
| `agent` | Image | `gcr.io/cloud-ingest/tsop-agent:latest` |
@@ -132,6 +132,16 @@ STS_AGENT_POOL=my-agents
HOSTNAME=agent-host
```
The following optional variables of `sts-agent/.env` set the health check of the emulator:
| Variable | Default | Meaning |
|---|---|---|
| `HEALTHCHECK_INTERVAL` | `10s` | Time between checks |
| `HEALTHCHECK_TIMEOUT` | `3s` | Time after which a check fails |
| `HEALTHCHECK_START_PERIOD` | `10s` | Time after the start in which failed checks do not count |
| `HEALTHCHECK_START_INTERVAL` | `1s` | Time between checks during the start period |
| `HEALTHCHECK_RETRIES` | `3` | Consecutive failed checks that make the container unhealthy |
Build the emulator and start both containers:
```bash
+5 -5
View File
@@ -13,11 +13,11 @@ services:
PROJECT_NUMBER: ${PROJECT_NUMBER}
healthcheck:
test: ["CMD", "/imds-emulator", "-check"]
interval: 10s
timeout: 3s
start_period: 10s
start_interval: 1s
retries: 3
interval: ${HEALTHCHECK_INTERVAL:-10s}
timeout: ${HEALTHCHECK_TIMEOUT:-3s}
start_period: ${HEALTHCHECK_START_PERIOD:-10s}
start_interval: ${HEALTHCHECK_START_INTERVAL:-1s}
retries: ${HEALTHCHECK_RETRIES:-3}
agent:
image: gcr.io/cloud-ingest/tsop-agent:latest