Skip to content

Commit

Permalink
testing: fix Kibana healthcheck (#20683)
Browse files Browse the repository at this point in the history
* testing: fix Kibana healthcheck

With elastic/kibana#74656,
Kibana images will no longer have Python installed.
Instead of parsing the result, just look for the
string "Looking good", which indicates Kibana is
healthy.
  • Loading branch information
axw committed Aug 19, 2020
1 parent 0038599 commit 73f8bea
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion testing/environments/snapshot-oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ services:
kibana:
image: docker.elastic.co/kibana/kibana-oss:8.0.0-SNAPSHOT
healthcheck:
test: ["CMD-SHELL", 'python -c ''import urllib, json; response = urllib.urlopen("http://localhost:5601/api/status"); data = json.loads(response.read()); exit(1) if data["status"]["overall"]["state"] != "green" else exit(0);''']
test: ["CMD-SHELL", "curl -s http://localhost:5601/api/status | grep -q 'Looking good'"]
retries: 600
interval: 1s

Expand Down
2 changes: 1 addition & 1 deletion testing/environments/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ services:
kibana:
image: docker.elastic.co/kibana/kibana:8.0.0-SNAPSHOT
healthcheck:
test: ["CMD-SHELL", 'python -c ''import urllib, json; response = urllib.urlopen("http://localhost:5601/api/status"); data = json.loads(response.read()); exit(1) if data["status"]["overall"]["state"] != "green" else exit(0);''']
test: ["CMD-SHELL", "curl -s http://localhost:5601/api/status | grep -q 'Looking good'"]
retries: 600
interval: 1s
2 changes: 1 addition & 1 deletion x-pack/libbeat/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ services:
file: ${ES_BEATS}/testing/environments/${TESTING_ENVIRONMENT}.yml
service: kibana
healthcheck:
test: ["CMD-SHELL", 'python -c ''import urllib, json; response = urllib.urlopen("http://myelastic:changeme@localhost:5601/api/status"); data = json.loads(response.read()); exit(1) if data["status"]["overall"]["state"] != "green" else exit(0);''']
test: ["CMD-SHELL", "curl -u myelastic:changeme -f http://localhost:5601/api/status | grep -q 'Looking good'"]
retries: 1200
interval: 5s
start_period: 60s
Expand Down

0 comments on commit 73f8bea

Please sign in to comment.