Closed
Description
Our docker entry point script has special logic to convert environment variables into -E
options when starting Elasticsearch.
However this logic is not available when executing CLI commands via docker exec
(or other similar commands like kubectl exec
, etc) which surprises people, and makes it difficult to run some commands within a container.
I definitely don't think we should enable this environment parsing by default, but I wonder if there's value in having some sort of option for this.
A couple of ideas:
- Have a
--docker
(or--parse-env
) option to our CLI tools (this could be handled inelasticsearch-cli
orelasticsearch-env
) - Have a
elasticsearch-parse-env
script that generates-E
options as output so that something like the below would work:
bin/elasticsearch-setup-passwords auto $(elasticsearch-parse-env)
I don't love any of this, but it's causing confusion right now so I think it's at least worth a discussion.
The CLI tools that I know of that make use of ES settings are (there may be others, I didn't dig too deeply):
- elasticsearch-node (node roles)
- elasticsearch-saml-metadata (realm settings)
- elasticsearch-setup-passwords (HTTP URL, HTTP SSL settings)
- elasticsearch-users (password hashing algorithm)