# Kubernetes Autodiscovery

**URL:** <https://discuss.elastic.co/t/kubernetes-autodiscovery/347610>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [November 21, 2023, 9:44am UTC](https://discuss.elastic.co/t/kubernetes-autodiscovery/347610 "2023-11-21T09:44:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xyz7](https://avatars.discourse-cdn.com/v4/letter/x/a183cd/32.png) [@xyz7](https://discuss.elastic.co/u/xyz7)\
**Post date:** [November 21, 2023, 9:44am UTC](https://discuss.elastic.co/t/kubernetes-autodiscovery/347610/1 "2023-11-21T09:44:55Z")

</div>

Hi @jsoriano,

Below topic suggests add\_kubernetes\_metadata is enabled by default if using hints-based autodiscover as mentioned in below reference configuration.

> [@Is add\_kubernetes\_metadata in filebeat enabled by default?](https://discuss.elastic.co/t/is-add-kubernetes-metadata-in-filebeat-enabled-by-default/232064):
>
> Just a general question I guess since the documentation wasn't very clear to me. When running Filebeat on Kubernetes as instructed here, [https://www.elastic.co/guide/en/beats/filebeat/master/running-on-kubernetes.html](https://www.elastic.co/guide/en/beats/filebeat/master/running-on-kubernetes.html) Is the add\_kubernetes\_metadata processor supposed to be enabled by default? Or do I need to configure to enable? I'm using v7.6.

![image](https://us1.discourse-cdn.com/elastic/original/3X/f/d/fd26047d62e3217202ebdd99a508c5f350de072f.png)

My filebeat config autodiscover part is like this:

```auto
    filebeat.autodiscover:
      providers:
        - type: kubernetes
          hints.enabled: true
          include_annotations: ["artifact.spinnaker.io/name","ad.datadoghq.com/tags"]
          templates:
            - condition:
                equals:
                  kubernetes.namespace: myapp

```

where I have **hints.enabled: true** , skipped **hints.default\_config** and have templates.

I'm using v7.9.0

Will add\_kubernetes\_metadata by default enabled in the above configuration as I have skipped hints.default\_config and used templates ?

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [November 21, 2023, 11:15am UTC](https://discuss.elastic.co/t/kubernetes-autodiscovery/347610/2 "2023-11-21T11:15:25Z")

</div>

Hey @xyz7, welcome to discuss 🙂

> [@xyz7](#):
>
> Below topic suggests add\_kubernetes\_metadata is enabled by default if using hints-based autodiscover as mentioned in below reference configuration.

It is not exactly that `add_kubernetes_metadata` is enabled when using hints-based autodiscover. When using hints-based autodiscover, Beats will include in events the same metadata that would be included by this processor, but only for events of configurations generated from hints.

Functionally this is indeed similar to using `add_kubernetes_metadata`, but enrichment done by hints-based autodiscover is generally more optimal in resources.

> [@xyz7](#):
>
> Will add\_kubernetes\_metadata by default enabled in the above configuration as I have skipped hints.default\_config and used templates ?

It won't be enabled. Enrichment will only be done for configurations generated from hints, but won't happen for the configurations generated from templates.

---

<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 19, 2023, 1:15pm UTC](https://discuss.elastic.co/t/kubernetes-autodiscovery/347610/3 "2023-12-19T13:15:42Z")

</div>

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