# Kubernetes autodiscovery for ephemeral containers

**URL:** <https://discuss.elastic.co/t/kubernetes-autodiscovery-for-ephemeral-containers/253840>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [October 30, 2020, 4:13pm UTC](https://discuss.elastic.co/t/kubernetes-autodiscovery-for-ephemeral-containers/253840 "2020-10-30T16:13:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marqc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marqc/32/78169_2.png) [@marqc](https://discuss.elastic.co/u/marqc)\
**Post date:** [October 30, 2020, 4:13pm UTC](https://discuss.elastic.co/t/kubernetes-autodiscovery-for-ephemeral-containers/253840/1 "2020-10-30T16:13:36Z")

</div>

Quick question for maintainers. How do you think filebeat should consider ephemeral containers. Should they be scrapped by default? Optionally when some additional autodiscovery flag is set? Or should they never be scraped.

Ephemeral cotainers are "short living" containers within k8s pods designed for debugging.

> **[Ephemeral Containers](https://kubernetes.io/docs/concepts/workloads/pods/ephemeral-containers/)**
>
> FEATURE STATE: Kubernetes v1.16 \[alpha\] This page provides an overview of ephemeral containers: a special type of container that runs temporarily in an existing Pod to accomplish user-initiated actions such as troubleshooting. You use ephemeral...

  

> **[Debug Running Pods](https://kubernetes.io/docs/tasks/debug-application-cluster/debug-running-pod/#ephemeral-container)**
>
> This page explains how to debug Pods running (or crashing) on a Node.
> Before you begin Your Pod should already be scheduled and running. If your Pod is not yet running, start with Troubleshoot Applications. For some of the advanced debugging steps...

Currently only normal and init containers are supported and both are scraped by default [https://github.com/elastic/beats/blob/master/libbeat/autodiscover/providers/kubernetes/pod.go#L268](https://github.com/elastic/beats/blob/master/libbeat/autodiscover/providers/kubernetes/pod.go#L268)

Adding support for ephemerals seems to be some small patch in linked code. But I don't think it should be enabled by default. What's more it is still considered alpha in k8s (and may be incompatible with some older k8s releases).

---

<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 4, 2020, 1:57pm UTC](https://discuss.elastic.co/t/kubernetes-autodiscovery-for-ephemeral-containers/253840/2 "2020-11-04T13:57:53Z")

</div>

+1 to discover ephemeral containers, keeping the conversation in [https://github.com/elastic/beats/pull/22389](https://github.com/elastic/beats/pull/22389)

---

<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 2, 2020, 3:57pm UTC](https://discuss.elastic.co/t/kubernetes-autodiscovery-for-ephemeral-containers/253840/3 "2020-12-02T15:57:59Z")

</div>

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