# Metricbeat modules.d as hostpath

**URL:** <https://discuss.elastic.co/t/metricbeat-modules-d-as-hostpath/157458>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [November 20, 2018, 1:48am UTC](https://discuss.elastic.co/t/metricbeat-modules-d-as-hostpath/157458 "2018-11-20T01:48:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pavan\_Kumar2](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@Pavan\_Kumar2](https://discuss.elastic.co/u/Pavan_Kumar2)\
**Post date:** [November 20, 2018, 1:48am UTC](https://discuss.elastic.co/t/metricbeat-modules-d-as-hostpath/157458/1 "2018-11-20T01:48:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 18, 2018, 1:48am UTC](https://discuss.elastic.co/t/metricbeat-modules-d-as-hostpath/157458/2 "2018-12-18T01:48:14Z")

</div>

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