Metricbeat modules.d as hostpath

Hi,

I new to elastic beats. I have a question regarding metricbeat.. Whenever I try to use hostpath for modules.d for metricbeat, the data in modules.d in pod gets removed and replaced by nothing (modules.d folder becomes empty)..

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: metricbeat
spec:
selector:
matchLabels:
name: metricbeat
template:
metadata:
labels:
name: metricbeat
spec:
nodeSelector:
zone: default
containers:

  • image: metricbeat image
    name: metricbeat
    env:
  • name: ES_HOST
    value: elasticsearch
  • name: ES_PORT
    value: "9200"
    resources: {}
    terminationMessagePath: /dev/termination-log
    volumeMounts:
  • mountPath: /usr/share/metricbeat/modules.d #this becomes empty
    name: metricbeat-modules-claim
    readOnly: true
    serviceAccount: default
    terminationGracePeriodSeconds: 10
    volumes:
  • name: metricbeat-modules-claim
    hostPath:
    path: /opt/metricbeat-modules

If I remove the volumes and volumeMounts the data in the pod in directory (/usr/share/metricbeat/modules.d) has the data that I put while creating docker image..

Can someone help me how to use hostPath for modules.d? All examples are showing using configMap for modules.d..

Thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.