Setting elastic password via environment variable is not particularly secure so we want to
set it via file. The file is provided by kubernetes CSI driver.
The suggestion for metricbeat on kubernetes that I found so far is to change from the env variant:
There is a file in /mnt/secrets-volume/ called elkPassword that
contains the password. This file is mounted dynamically at pod-creation by the CSI driver.
Any ideas why this does not work?
Is the syntax incorrect or is it just impossible to read
a password from a file?
Yeah, using the keystore was my workaround. At the startup of the pod
I run some commands that create the keystore and adds the password as ES_PWD
which is then picked up by metricbeat. A bit clunky but it sort of works.
Note that this requires the file to be mounted at the /mnt/... path using
volumes and volumeMount and actually injecting the file at runtime (using a CSI driver for example).
Regarding the ${file:/mnt/... syntax, I cannot find it again, done some extensive searching, very possible it was dreamed up by an attempt to
get some info from an AI
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.