-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve health check for Fleet Server (#1824)
Fleet Server restarts once after being healthy. Agents enrolling during this restart fail and need to be restarted. Improve the healthcheck so it expects to have three healthy healthchecks before considering Fleet Server ready to enroll.
- Loading branch information
Showing
5 changed files
with
36 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
set -e -o pipefail | ||
|
||
healthcheck() { | ||
curl --cacert /etc/ssl/elastic-agent/ca-cert.pem -f https://localhost:8220/api/status | grep -i healthy 2>&1 >/dev/null | ||
} | ||
|
||
# Fleet Server can restart after announcing to be healthy, agents connecting during this restart will | ||
# fail to enroll. Expect 3 healthy healthchecks before considering it healthy. | ||
expected=3 | ||
for i in $(seq $expected); do | ||
healthcheck | ||
sleep 1 | ||
done | ||
|
||
exit 0 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters