The health-check
command-line tool concurrently checks all target groups' health status (for target groups that are attached to a load balancer).
The program returns 0 when you have at least one healthy target for each service.
health-check
is available for MacOS and Linux based operating systems.
Installation for MacOS is the easiest with Homebrew. If you do not have homebrew installed, click here.
brew install warrensbox/tap/health-check
Installation for other linux operation systems.
curl -L https://raw.githubusercontent.com/warrensbox/health-check/release/install.sh | bash
docker pull warrensbox/health-check:latest
or
docker pull docker.pkg.github.com/warrensbox/health-check/health-check:latest
Alternatively, you can install the binary from source here
- You must always provide the
ecs-cluster
on the command-line - Optionally, you can provide the
delay
option to delay in-between checks - Optionally, you can also provide the
attempts
option for the number of attempts for the health check
- You you provide the
-e
flag, the program will exit withexit code 1
if any of the target is unhealthy - This is useful for continuous delivery - Jenkins, CircleCI and others
- Likewise, if you dont't provide the
-e
flag, the program will simply exit withexit code 0
if any of the target is unhealthy
On jenkins you may not want the progress bar to be printed out as it prints out the progress line by line. You can use the -b
option to disable progress bar. By default, it prints the progress bar.
docker run --rm \
-e AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \
-e AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
-e AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN} \
-e AWS_REGION=${AWS_REGION} \
-e AWS_DEFAULT_REGION=${AWS_REGION} \
health-check --ecs-cluster esp-devops --attempts 50 --delay 2
- This command line tool only queries all target group that is attached to a load balancer.
- Given an ecs cluster is provided, it concurrently checks for the health status for all target groups in that cluster.
- If a target groups shows at least 1 healthy task, it will return the check while other target groups health checks are concurrently going on.
- This way, instead of using a loop to check each target group health status - one after another, we can minimize the time by checking all the target groups' health concurrently. The total wait time for the results would be the
number of attempts
Xdelay time
(in seconds). - The program will not exit with error code 1 unless you pass the
-e
flag for any unhealthy targets.
Please open issues here: New Issue
Or open a Pull Request.