From 29203a7aebdace02876de46d150778ea7f655bd5 Mon Sep 17 00:00:00 2001 From: Slawomir Koszewski Date: Tue, 20 Oct 2026 10:33:17 +0200 Subject: [PATCH] Parametrized healthcheck parameters. --- docs/storage-transfer.md | 12 +++++++++++- sts-agent/compose.yaml | 10 +++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/docs/storage-transfer.md b/docs/storage-transfer.md index 423eb48..ae533ea 100644 --- a/docs/storage-transfer.md +++ b/docs/storage-transfer.md @@ -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 diff --git a/sts-agent/compose.yaml b/sts-agent/compose.yaml index f6d5dab..5ead4c0 100644 --- a/sts-agent/compose.yaml +++ b/sts-agent/compose.yaml @@ -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