Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Healthchecks in elastic-docker-tls.yml always pass. #1846

Open
ryanhockstad opened this issue Oct 13, 2021 · 2 comments
Open

Healthchecks in elastic-docker-tls.yml always pass. #1846

ryanhockstad opened this issue Oct 13, 2021 · 2 comments

Comments

@ryanhockstad
Copy link

ryanhockstad commented Oct 13, 2021

The current healthchecks, which look like this: curl --cacert $CERTS_DIR/ca/ca.crt -s https://localhost:9200 >/dev/null; if [[ $$? == 52 ]]; then echo 0; else echo 1; fi, pass even if a node is exposed on a port other than 9200, or if the node is not accessible for some reason. The echo commands both return a response code of 0.

Getting rid of the if statement fixes this, but we could also add logic to the healthcheck based on the http response code.

@lcawl
Copy link
Contributor

lcawl commented Nov 23, 2021

I believe this issue relates to the config files referenced in https://www.elastic.co/guide/en/elastic-stack-get-started/master/get-started-docker.html @debadair

@lockewritesdocs
Copy link
Contributor

@lcawl, I'm currently updating these instructions in #1888. I'll be updating the section for Docker Compose with TLS in a separate PR, which will be the only Docker Compose option.

The healthcheck in question is in elastic-docker-tls.yml, which would need to change with security enabled by default. Something like:

curl --cacert %ES_HOME%\tls_auto_config_<timestamp>\http_ca.crt -u elastic https://localhost:9200

@ryanhockstad, I think that the same issue might persist with this command. Can you help with the logic for implementing a healthcheck based on the HTTP response code?

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

No branches or pull requests

3 participants