Commit 0a8c5b9
committed
Refactor kubernetes autodiscover to avoid skipping short-living pods (#24742)
Refactor logic in kubernetes autodiscover that decides when
to generate events to try to address issues with short-living
containers.
Kubernetes autodiscover can generate events without network
information now (without host or port/ports). This allows to generate
events for pods that haven't started yet, or have succeeded/failed
before generating a running event. These events still include the
container id, so they can be used to collect logs. Still, no start event
is generated if no pod ip and no container ids are available.
Some helpers have been added to obtain relevant information from
pods and their containers.
Some additional small refactors are done to improve readability.
(cherry picked from commit b4b6e6e)1 parent 04c62ef commit 0a8c5b9
6 files changed
Lines changed: 722 additions & 284 deletions
File tree
- filebeat/autodiscover/builder/hints
- libbeat
- autodiscover/providers/kubernetes
- common/kubernetes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | 96 | | |
102 | 97 | | |
103 | 98 | | |
| |||
0 commit comments