Set password during deployment elasticsearch for my app

I am running my app as a container that need to access Elasticsearch deployed as container also, so in my app settings yaml i have to enter credentials and url for elastic that will be deployed also in docker.

How can i specified the elastic password to deploy Elasticsearch container and kibana and deploy my container app with that url, elastic user and password.

I have only find ways to autogenerate passwords but then i cant use that password in my app i need to set a hardcoded password or what is best way to do this?

You can't pass in new credentials unless the Elasticsearch cluster is setup, which means you need to first use the elasticsearch-setup-passwords command to setup admin level access.

how do people usually deploy container apps that depends on Elasticsearch and all is deployed at same time and had to set credentials in the apps? do anyone have like a yaml sample for docker-compose?

For docker installation, you can specify password for the elastic user in your docker-compose file, e.g.:

    environment:
      - ELASTIC_PASSWORD=$ELASTIC_PASSWORD 

Full example can be found in this documentation page.

1 Like

Ahh, thanks for that :smiley:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.