Files
kubernetes/test/e2e_node
Davanum Srinivas 914ddf4468 kubelet: improve CRI stats for resource metrics and testing
properly support the resource metrics endpoint when `PodAndContainerStatsFromCRI` is enabled and fix the related e2e tests.

Stats Provider:
- add container-level CPU and memory stats to `ListPodCPUAndMemoryStats` so the resource metrics endpoint has complete data
- add `aggregatePodSwapStats` to compute pod-level swap from container stats (CRI doesn't provide pod-level swap directly)
- add missing memory stats fields: `AvailableBytes`, `PageFaults`, and `MajorPageFaults`
- add platform-specific implementations for Linux and Windows

Tests:
- skip cAdvisor metrics test when `PodAndContainerStatsFromCRI` is enabled (cAdvisor metrics aren't available in that mode)
- fix expected metrics in `ResourceMetricsAPI` test
- `node_swap_usage_bytes` is only available with cAdvisor (need to verify!)
- Add `dumpResourceMetricsForPods` helper to log actual metric values when tests fail, making debugging easier

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-12-17 10:52:32 -05:00
..
2025-07-04 08:55:57 +02:00
2025-11-01 12:55:01 +08:00
2024-12-02 16:59:34 +01:00
2025-09-27 19:57:47 +03:00
2025-07-29 20:20:08 +02:00
2025-11-10 09:41:02 +00:00
2025-08-11 15:14:46 +02:00