Check elasticsearch cluster health without authentication when security feature is enable

I want to set up elasticsearch cluster automatically with ansible. Reset built-in users password with elasticsearch-setup-password after cluster is up. There is a readiness probe to check if cluster is up and ready. But I could not check cluster status before reset password for built-in user according to api authentication. Tried to pass ELASTIC_PASSWORD environment, but it didn't work. I use kubernetes to deploy elasticsearch. So how to achieve this?

elasticsearch version: 7.2

elasticsearch-setup-passwords is not really meant to be used in scripting or from a configuration management system. In your case I would suggest that

How did you try it and how didn't it work ? :slight_smile:

See our docs on how to pass ELASTIC_PASSWORD correctly: Encrypting communications in an Elasticsearch Docker Container | Elasticsearch Guide [8.11] | Elastic . Once this is configured, you can set the passwords for all the built in users using the change passwords API