Go to file
Al Bailey d2f959aa1b Debian: collectd: get kubernetes pods through CLI
Using the kubernetes client in collectd on Debian leads to
a leak of eventpoll objects.

CentOS does not exhibit this leak.
Invoking the API through python services does not leak.
Newer versions of kubernetes client do not affect the leak.

The leak is related to the collectd event system and its
interaction with the API.  The resolution is to spawn a
subprocess (kubectl) and get the results from it.

The kubectl results (json) are not kubernetes objects, so
utility methods have been added to convert to the object
types (pod, status, metadata) that are explicitly used
by the cpu and memory plugin.
Note: annotations are just a dictionary in API or CLI.

Test Plan:
 Verify: kube_get_local_pods (original code) called once
per second from the cpu plugin causes a leak.
 Verify: kube_get_local_pods (updated code) called once
per second from the cpu plugin does not cause a leak.
 Verify: no 'new' stacktraces in the collectd logs

Closes-Bug: #1998953

Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I340b27926e2614e7ab55d16d961d9b680e7d1321
2022-12-07 02:26:44 +00:00
2019-09-09 14:37:23 -05:00
2021-07-15 12:02:38 -03:00
2021-07-15 12:02:38 -03:00
2019-09-09 14:37:23 -05:00
2019-09-09 14:37:23 -05:00
2019-09-09 14:37:23 -05:00
Description
StarlingX system monitoring and repoting tools
4.9 MiB
Languages
Python 85.7%
Perl 13.1%
Makefile 1%
Shell 0.1%