Closed kusolank closed 2 weeks ago
same issue here, below is my heap profile and my client-go version is v0.25.3.
and my use case here is that prometheus uses k8s client to do service discovery
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
Same issue here:
(pprof) top
Showing nodes accounting for 91.72GB, 99.67% of 92.03GB total
Dropped 584 nodes (cum <= 0.46GB)
Showing top 10 nodes out of 15
flat flat% sum% cum cum%
91.72GB 99.67% 99.67% 91.91GB 99.87% io.ReadAll
0 0% 99.67% 91.91GB 99.87% k8s.io/client-go/informers/core/v1.NewFilteredPodInformer.func1
0 0% 99.67% 91.91GB 99.87% k8s.io/client-go/kubernetes/typed/core/v1.(*pods).List
0 0% 99.67% 91.91GB 99.88% k8s.io/client-go/rest.(*Request).Do
0 0% 99.67% 91.91GB 99.87% k8s.io/client-go/rest.(*Request).Do.func1
0 0% 99.67% 91.91GB 99.88% k8s.io/client-go/rest.(*Request).request
0 0% 99.67% 91.91GB 99.87% k8s.io/client-go/rest.(*Request).request.func3
0 0% 99.67% 91.91GB 99.87% k8s.io/client-go/rest.(*Request).request.func3.1 (inline)
0 0% 99.67% 91.91GB 99.87% k8s.io/client-go/rest.(*Request).transformResponse
0 0% 99.67% 91.91GB 99.87% k8s.io/client-go/tools/cache.(*ListWatch).List
+1 I have the same problem
I was able to mitigate this issue by using grpc as content type.
@gnuletik Can you please help with the example?
You can set the ContentType
value of the config you provide when creating the clientset.
kubeConfig.ContentType = "application/vnd.kubernetes.protobuf"
// creates the clientset
kubeClient, err := kubernetes.NewForConfig(kubeConfig)
if err != nil {
return nil, err
}
@gnuletik Thanks, let me try this as well
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/reopen
/remove-lifecycle rotten
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
@k8s-triage-robot: Closing this issue, marking it as "Not Planned".
k8sClientSet.CoreV1().Pods("").List(context.Background(), metav1.ListOptions{})
and NewFilteredEventInformer.ListFunc is consuming high chunk of memory when there are large number of pods and pod churn in cluster.
Using them to get resources in every minute same issue was reported on #871