Variables for production environment

Hi all, I am trying to put together a kubernetes yaml file to deploy opendistro & kibana. The default login is admin/admin. Are there any environment variables that you can use to set the default admin to a hash of your own for security reasons on initial deploy?


So in the mean time until environment variables are available I created an initContainer to get around this. It’s a bit of a dirty fix but works for now. You can create your hash and then place the script in an s3 bucket or storage of your choice, just keep it secure though. the script is as follows:


sed -i ‘/admin:/!b;n;c hash: “your-very-secure-hash”’ /usr/share/elasticsearch/plugins/opendistro_security/securityconfig/internal_users.yml
sed -i ‘/logstash:/!b;n;c hash: “your-very-secure-hash”’ /usr/share/elasticsearch/plugins/opendistro_security/securityconfig/internal_users.yml

sh /usr/share/elasticsearch/plugins/opendistro_security/tools/ -cd /usr/share/elasticsearch/plugins/opendistro_security/securityconfig/ -icl -nhnv -cacert /usr/share/elasticsearch/config/root-ca.pem -cert /usr/share/elasticsearch/config/kirk.pem -key /usr/share/elasticsearch/config/kirk-key.pem

then call it in the yaml as follows:
- name: fixauthadmin
command: [“wget”, “”, “;”, “chmod”, “755”, “”, “;”, “./”]
image: amazon/opendistro-for-elasticsearch:1.8.0
- mountPath: /usr/share/elasticsearch/data
name: data