Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cgroups: add option to use Kubelet for pods metadata #14891

Merged

Conversation

ilyam8
Copy link
Member

@ilyam8 ilyam8 commented Apr 11, 2023

Summary

An attempt to fix: #14843


This PR adds an option to retrieve Pods metadata from Kubelet instead of the Kubernetes API Server. This can mitigate the problem when Kube API Server is overloaded with a large number of requests. Larger cluster (more nodes -> more Netdata children instances) - more load on Kube API Server (#14843 is a 100+ nodes cluster).

Note We need Pods metadata to enrich cgroups metrics in K8s: to resolve names and add labels. Each child instance of Netdata executes requests.

Kubelet's /pods endpoint is undocumented and shouldn't be relied on (see 1, 2) - therefore it is disabled by default. But it is nice to have this as an option for huge clusters.

Implemented by adding two environment variables:

  • USE_KUBELET_FOR_PODS_METADATA: if set (the value doesn't matter) retrieve Pods metadata from Kubelet.
  • KUBELET_URL: if set use as Kubelet URL, if not set the default is https://localhost:10250.

Accompanying changes added in netdata/helmchart#349.

Test Plan

Tested by installing this branch on a K8s cluster (kind) and ensuring that container name resolution works.

Additional Information
For users: How does this change affect me?

@ilyam8 ilyam8 force-pushed the cgroups_k8s_use_kubelet_for_pods_metadata branch from 58495a5 to f388c55 Compare April 12, 2023 19:35
@ilyam8 ilyam8 changed the title cgroups: an option to use Kubelet for pods metadata cgroups: add option to use Kubelet for pods metadata Apr 12, 2023
@ilyam8 ilyam8 merged commit 068ae1c into netdata:master Apr 12, 2023
@ilyam8 ilyam8 deleted the cgroups_k8s_use_kubelet_for_pods_metadata branch April 12, 2023 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/collectors Everything related to data collection collectors/cgroups
Projects
None yet
3 participants