cgroups: add option to use Kubelet for pods metadata #14891
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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).
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 ishttps://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?