Skip to content

feat(keeper): add health-check sidecar for high availability (#110)#128

Open
FaithOnuh wants to merge 1 commit intoSoroLabs:mainfrom
FaithOnuh:feat/issue-110-health-check-sidecar
Open

feat(keeper): add health-check sidecar for high availability (#110)#128
FaithOnuh wants to merge 1 commit intoSoroLabs:mainfrom
FaithOnuh:feat/issue-110-health-check-sidecar

Conversation

@FaithOnuh
Copy link
Copy Markdown

Summary

Closes #110

Adds a lightweight health-check sidecar that monitors the keeper's /health endpoint and triggers a restart after a configurable number of consecutive failures, preventing both flapping and undetected outages.

Changes

  • keeper/health-check-sidecar.sh — POSIX shell sidecar script. Polls /health on a configurable interval, tracks consecutive failures, and executes a RESTART_CMD only after the failure threshold is crossed. Includes timestamped INFO / WARN / CRITICAL log levels and a 5-second curl timeout to guard against network hangs.

  • docker-compose.yml — Adds a keeper-sidecar service using the minimal curlimages/curl image (~12 MB). Mounts the script read-only and exposes SIDECAR_POLL_INTERVAL_S / SIDECAR_FAILURE_THRESHOLD as top-level Compose variables.

  • keeper/README_SIDECAR.md — Deployment guide covering Docker Compose, standalone process, and systemd unit configurations, plus a full environment variable reference and log format examples.

Configuration

Variable Default Description
SIDECAR_POLL_INTERVAL_S 15 Seconds between health polls
SIDECAR_FAILURE_THRESHOLD 3 Consecutive failures before restart
RESTART_CMD kill -SIGTERM 1 Command to restart the keeper

Testing

bash

Start the stack

docker compose up -d

Simulate a failure by stopping the keeper

docker compose stop keeper

Watch sidecar logs — after 3 failures it will trigger the restart command

docker compose logs -f keeper-sidecar

…s#110)

- Add keeper/health-check-sidecar.sh: polls /health, restarts after
  FAILURE_THRESHOLD consecutive failures to prevent flapping
- Update docker-compose.yml: add keeper-sidecar service using
  curlimages/curl with configurable env vars
- Add keeper/README_SIDECAR.md: deployment guide covering Docker
  Compose, standalone, and systemd usage
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 29, 2026

@FaithOnuh Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Infra] Implement a Robust Health Check Sidecar for Deployment

1 participant