Using Metricbeat Keystore but it is not working (Metricbeat v6.6.0)?

5/8/2021

I'm trying to use a keystore value in my metricbeatbeat configuration and I can't seem to get it working...

I have created initContainer in that I am just creating keystore and add my elasticsearch password in ES_PWD!

metricbeat --path.config=/usr/share/metricbeat/keystore -c /etc/metricbeat.yml keystore create
echo 'my-ES-clear-text-pwd' | metricbeat --path.config=/usr/share/metricbeat/keystore -c /etc/metricbeat.yml keystore add ES_PWD --stdin --force 
metricbeat --path.config=/usr/share/metricbeat/keystore -c /etc/metricbeat.yml keystore list

sharing volumes between initContainer and actual container!

In actual metricbeat container trying to run metricbeat service but it is not starting. (./metricbeat --path.config=/usr/share/metricbeat/keystore -c /etc/metricbeat.yml -e)

However pod is running but metricbeat service is not starting up inside it!

If i exec into pod and manually copy metricbeat.keystore and if I try to run metricbeat service manually then it is running.

I found one similar issue: https://discuss.elastic.co/t/using-keystores-not-working-v6-6-0/167301

However, I can't do it manually every time since my metricbeat pod is deploy as daemonset and deployment in my K8s cluster.

Thanks in advance.

-- Ak96
elastic-beats
elasticsearch
keystore
kubernetes
metricbeat

0 Answers