Commit Graph

136 Commits

Author SHA1 Message Date
Eric Lin
fea15977c8 Consider threads-max when deciding MaxPID.
Fixes kubernetes#107111
2022-01-17 21:51:59 +00:00
Davanum Srinivas
9405e9b55e
Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-09 21:31:26 -05:00
Sascha Grunert
de37b9d293
Make CRI v1 the default and allow a fallback to v1alpha2
This patch makes the CRI `v1` API the new project-wide default version.
To allow backwards compatibility, a fallback to `v1alpha2` has been added
as well. This fallback can either used by automatically determined by
the kubelet.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-11-17 11:05:05 -08:00
Antonio Ojea
d126b14838 migrate nolint coments to golangci-lint 2021-11-17 13:58:53 +01:00
James Sturtevant
ab2e58c416 Get networks stats directly 2021-11-10 12:43:56 -08:00
James Sturtevant
c39945c116 Add unit tests to existing code 2021-11-10 11:50:04 -08:00
Peter Hunt
6b3f8e5662 kubelet: fallback to partial CRI stats if full fails
This is partially to allow the kube alpha tests to pass until CRI implementations have support, but also to handle this error situation a bit more elegantly

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2021-10-29 09:40:20 -04:00
Peter Hunt
feb5f5e0ed kubelet: use helper function to check for nil fields in sandbox stats
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2021-10-29 09:40:20 -04:00
Peter Hunt
85e8a4bf73 kubelet stats: use UsageNanoCores if available
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2021-10-29 09:40:20 -04:00
Peter Hunt
ffdb4b9c4a kubelet: slightly move around some cri stats functions
to reduce duplication and add clarity

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2021-10-29 09:40:20 -04:00
Peter Hunt
d2c436700e kubelet stats: add support for podAndContainerStatsFromCRI
This commit adds an initial implementation of translating from the new CRI fields
to the /stats/summary PodStats object

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2021-10-29 09:40:20 -04:00
Peter Hunt
7866287ba1 kubelet stats: wire up podAndContainerStatsFromCRI feature gate
though it is currently unused

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2021-10-29 09:40:20 -04:00
Kubernetes Prow Robot
cab54856f1
Merge pull request #104933 from vikramcse/automate_mockery
conversion of tests from mockery to mockgen
2021-09-30 18:33:21 -07:00
vikram Jadhav
0de4397490 mockery to mockgen conversion 2021-09-25 16:15:08 +00:00
Kubernetes Prow Robot
44d4d007bf
Merge pull request #103424 from 249043822/br-cadvisor-perf
Optimize kubelet stats provider for perfomace bottleneck
2021-09-21 11:56:18 -07:00
Kubernetes Prow Robot
2f6b9166d7
Merge pull request #104039 from YanzhaoLi/extract-containerdid-from-various-cgrouppath
Get containerID from systemd-style cgroupPath in cri_stats_provider
2021-08-25 17:05:22 -07:00
Stephen Augustus
481cf6fbe7
generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-24 15:47:49 -04:00
YanzhaoLi
545d898584 Extract containerID from systemd-style cgroupPath in cri_stats_provider
And fix test to generate UUID without dash
2021-08-11 19:03:56 -07:00
KeZhang
1467065352 Optimize kubelet stats provider for perfomace bottleneck 2021-07-14 11:11:12 +08:00
Kubernetes Prow Robot
3e588be763
Merge pull request #101712 from SergeyKanzhelev/disableAcceleratorUsageMetricsOnContainerd
disable collecting of accelerator metrics in cAdvisor
2021-05-17 13:39:51 -07:00
Joel Smith
1e0ca5bdc7 Fix log spam for du failure on pod etc-hosts metrics 2021-05-03 08:29:56 -06:00
Sergey Kanzhelev
e8ae653c1d disable collecting of accelerator metrics and exposing it for containerd 2021-04-30 22:16:34 +00:00
Niekvdplas
fec272a7b2 Fixed several spelling mistakes 2021-03-30 23:02:09 +02:00
James Sturtevant
c9eff4e906 Get filesystem stats for files on Windows 2021-03-08 12:50:23 -08:00
Kubernetes Prow Robot
930ca85613
Merge pull request #99607 from krzysiekg/structured_logging_pkg_kubelet_stats
Migrate pkg/kubelet/stats to structured logging
2021-03-04 00:28:38 -08:00
Krzysztof Gibuła
7097d4f8e2 Migrate pkg/kubelet/stats to structured logging 2021-03-01 18:52:34 +01:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Kubernetes Prow Robot
ac101cbdda
Merge pull request #97042 from joelsmith/eviction
Measure/compute used ephemeral storage in stats provider, not eviction manager
2020-12-14 08:47:30 -08:00
Joel Smith
29ff2fe528 Remove now-unused eviction helpers, fix unit test TestCRIListPodStats 2020-12-03 13:04:25 -07:00
Derek Carr
acb43c7c4a Rework hostfs metrics
Ephemeral storage usage should be calculated by the metrics code,
not the eviction code.
2020-12-03 13:04:25 -07:00
ruiwen-zhao
36b4ccdb7c Add AcceleratorStats to cri_stats_provider 2020-11-30 19:30:02 +00:00
Qiutong Song
a59a6b984f fix CPU time of pod stats with cs.CPU.Time
Signed-off-by: Qiutong Song <songqt01@gmail.com>
2020-11-03 09:29:18 +00:00
Anderson Queiroz
8c724d7933 cleanup: fix golint errors in /pkg/kubelet/stats 2020-10-08 21:59:42 +02:00
Marek Siarkowicz
7d309e0104 Move Kubelet Summary API to staging repo 2020-09-22 18:23:28 +02:00
David Ashpole
0ffc149ccc move dashpole to emeritus in kubelet 2020-09-16 11:52:35 -07:00
Jordan Liggitt
f33dc28094 generated: hack/update-hack-tools.sh && hack/update-vendor.sh 2020-07-25 16:45:02 -04:00
Kubernetes Prow Robot
86ab25f038
Merge pull request #91716 from kadisi/append_mutations_kubelet
fix unexpected append mutations about pkg/kubelet package
2020-06-19 21:51:08 -07:00
Kubernetes Prow Robot
677e8d6871
Merge pull request #86223 from dashpole/owners_changes
Add dashpole as kubelet approver
2020-06-18 22:59:58 -07:00
kadisi
a75323c76b fix unexpected append mutations about pkg/kubelet package
Signed-off-by: kadisi <iamkadisi@163.com>
Co-authored-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
2020-06-03 13:36:57 +08:00
Davanum Srinivas
07d88617e5
Run hack/update-vendor.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:33 -04:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Davanum Srinivas
9006b2db69
Fix for API change in cadvisor
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:53:03 -04:00
tangcong
2b984b3e3a fix kubelet stats staticcheck error 2020-04-21 07:16:58 +08:00
louisgong
e56d40d048 remove unused param 2020-03-24 09:25:04 +08:00
louisgong
0efb70c0a2 eviction by process number 2020-03-24 09:25:04 +08:00
Joel Smith
da988294ec Work-around for missing metrics on CRI-O exited containers
HPA needs metrics for exited init containers before it will
take action. By setting memory and CPU usage to zero for any
containers that cAdvisor didn't provide statistics for, we
are assured that HPA will be able to correctly calculate
pod resource usage.
2020-03-05 13:20:43 -07:00
Kubernetes Prow Robot
ac97b2d65e
Merge pull request #83507 from lyft/support-resetting-cpuacct
Prevent returning invalid usageNanoCores value when cpuacct is reset in a live container
2020-02-09 08:45:53 -08:00
mattjmcnaughton
06b44c76fd
Correct comment around which integrations require cadvisor_stats
This commit is part of a larger effort to clean up references to `rkt`
in the kubelet.

Previously, this comment hard-coded which integrations required
the cadvisor stats provider. The comment has grown stale
(i.e. referenced rkt and did not reference cri-o).

Update the comment to instead point to the code which determines which
integrations need the cadvisor stats provider.
2020-01-05 09:23:09 -05:00
Kubernetes Prow Robot
a931227952
Merge pull request #83504 from lyft/remove-all-terminated-containers
cri_stats_provider: do not consider exited containers when calculating cpu usage
2019-12-16 17:53:39 -08:00
David Ashpole
fca84c02bb add dashpole as kubelet approver 2019-12-12 11:10:24 -08:00