Generate random admin password at the chart deployment

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):

2.19.1

Describe the issue:
I want to generate a random password for the default admin user and provide the secret to the helm chart installation. But according the documentation Modifying the YAML files - OpenSearch Documentation I have to use the plugins/opensearch-security/tools/hash.sh. So how can do that before beginning the cluster deployment?

Configuration:

@Hung You have a few options here. One is to enter the running OpenSearch docker container or Kubernetes pod and navigate to the tool.

Another way is the OpenSearch binary download. After unpacking, navigate to the tools folder and execute the hash.sh command.

Please be aware that OpenSearch containers already have OPENSEARCH_JAVA_HOME predefined. If you run in binary mode, you should use the following command.

env OPENSEARCH_JAVA_HOME=<path_to_opensearch_jdk> <path_to_hash_tool>/hash.sh

i.e. 

env OPENSEARCH_JAVA_HOME=/home/pablo/opensearch/opensearch-2.19.0/jdk/ /home/pablo/opensearch/opensearch-2.19.0/plugins/opensearch-security/tools/hash.sh

thanks @pablo
so as I can understand it’s something that it should be done “offline” first before deploying the helm chart right?

@Hung Ideallly yes. However, you can always update the admin password with securityadmin.sh or helm charts after the successful deployment.