Allow automatic Elasticsearch nodes discovery #3837
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows automatic discovery of Elasticsearch nodes by clients which support "sniffing" mode.
More precisely it:
http.publish_host
to the Pod hostname (in the form$(podname).$(governing service domain).$(namespace).svc
). Note that it is different fromnetwork.publish_host
, therefore I think we should not hit TestMutationHTTPToHTTPS is flaky #3723 again.*.$(governing service domain).$(namespace).svc
in the HTTP self signed certificate, for example:Autodiscovery mostly makes sense if the client has an interface in the Kubernetes network. Therefore DNS wildcards are added automatically in the SANs only in the self signed certificate.
IPs are ephemeral in a Kubernetes cluster, I think it is fair to assume that DNS issues should be handled by the client. During my tests with the Node.js client it has always been able to gently reconnect to the cluster while I was randomly deleting the Elasticsearch Pods.
A sample based on the official ones is available here if you want to test that feature.
Fixes #3182