# K8s autodiscovery for filebeat?

**URL:** <https://discuss.elastic.co/t/k8s-autodiscovery-for-filebeat/267977>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [March 22, 2021, 12:54pm UTC](https://discuss.elastic.co/t/k8s-autodiscovery-for-filebeat/267977 "2021-03-22T12:54:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![TimWardFS](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timwardfs/32/65108_2.png) [@TimWardFS](https://discuss.elastic.co/u/TimWardFS)\
**Post date:** [March 22, 2021, 12:54pm UTC](https://discuss.elastic.co/t/k8s-autodiscovery-for-filebeat/267977/1 "2021-03-22T12:54:19Z")

</div>

Does anyone please have the remotest clue how to find out what this means when trying to use K8s autodiscovery for filebeat?

```auto
Exiting: error in autodiscover provider settings: 
error setting up kubernetes autodiscover provider: 
unable to build kube config due to error: 
invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable

```

---

<div class="post-metadata">

**Author:** ![SeanPlacchettiRidge](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@SeanPlacchettiRidge](https://discuss.elastic.co/u/SeanPlacchettiRidge)\
**Post date:** [March 22, 2021, 1:27pm UTC](https://discuss.elastic.co/t/k8s-autodiscovery-for-filebeat/267977/2 "2021-03-22T13:27:47Z")

</div>

> [@TimWardFS](#):
>
> `KUBERNETES_MASTER`

Is there any extra information in the events? It sounds like your node doesn't have a need environmental variable for autodiscover.

---

<div class="post-metadata">

**Author:** ![TimWardFS](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timwardfs/32/65108_2.png) [@TimWardFS](https://discuss.elastic.co/u/TimWardFS)\
**Post date:** [March 22, 2021, 1:56pm UTC](https://discuss.elastic.co/t/k8s-autodiscovery-for-filebeat/267977/3 "2021-03-22T13:56:04Z")

</div>

What "events"?

I've got Prometheus doing K8s autodiscover perfectly happily on the same cluster BTW.

---

<div class="post-metadata">

**Author:** ![TimWardFS](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timwardfs/32/65108_2.png) [@TimWardFS](https://discuss.elastic.co/u/TimWardFS)\
**Post date:** [March 22, 2021, 3:32pm UTC](https://discuss.elastic.co/t/k8s-autodiscovery-for-filebeat/267977/4 "2021-03-22T15:32:53Z")

</div>

It turned out that adding `automountServiceAccountToken: true` made a difference.

That wasn't a very helpful error message, was it?

---

<div class="post-metadata">

**Author:** ![SeanPlacchettiRidge](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@SeanPlacchettiRidge](https://discuss.elastic.co/u/SeanPlacchettiRidge)\
**Post date:** [March 22, 2021, 5:41pm UTC](https://discuss.elastic.co/t/k8s-autodiscovery-for-filebeat/267977/5 "2021-03-22T17:41:09Z")

</div>

Looks like you found a solution, in the future, if you get a less-than-helpful k8s CRD deployment, you might find extra information in `kubectl get events` [Application Introspection and Debugging | Kubernetes](https://kubernetes.io/docs/tasks/debug-application-cluster/debug-application-introspection/) In my experience of debugging random ECK CRDs that's been pretty helpful.

---

<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:** [April 19, 2021, 5:42pm UTC](https://discuss.elastic.co/t/k8s-autodiscovery-for-filebeat/267977/6 "2021-04-19T17:42:06Z")

</div>

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