# Using metricbeat hostpath for modules.d

**URL:** <https://discuss.elastic.co/t/using-metricbeat-hostpath-for-modules-d/157203>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [November 18, 2018, 3:41am UTC](https://discuss.elastic.co/t/using-metricbeat-hostpath-for-modules-d/157203 "2018-11-18T03:41:10Z")\
**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 18, 2018, 3:41am UTC](https://discuss.elastic.co/t/using-metricbeat-hostpath-for-modules-d/157203/1 "2018-11-18T03:41:11Z")

</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 16, 2018, 3:41am UTC](https://discuss.elastic.co/t/using-metricbeat-hostpath-for-modules-d/157203/2 "2018-12-16T03:41:15Z")

</div>

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