File tree Expand file tree Collapse file tree 3 files changed +43
-11
lines changed
content/en/docs/reference Expand file tree Collapse file tree 3 files changed +43
-11
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ title : CRI Pod & Container Metrics
3
+ content_type : reference
4
+ weight : 50
5
+ description : >-
6
+ Collection of Pod & Container metrics via the CRI.
7
+ ---
8
+
9
+
10
+ <!-- overview -->
11
+
12
+ {{< feature-state for_k8s_version="v1.23" state="alpha" >}}
13
+
14
+ The [ kubelet] ( /docs/reference/command-line-tools-reference/kubelet/ ) collects pod and
15
+ container metrics via [ cAdvisor] ( https://github.com/google/cadvisor ) . As an alpha feature,
16
+ Kubernetes lets you configure the collection of pod and container
17
+ metrics via the {{< glossary_tooltip term_id="cri" text="Container Runtime Interface">}} (CRI). You
18
+ must enable the ` PodAndContainerStatsFromCRI ` [ feature gate] ( /docs/reference/command-line-tools-reference/feature-gates/ ) and
19
+ use a compatible CRI implementation (containerd >= 1.6.0, CRI-O >= 1.23.0) to
20
+ use the CRI based collection mechanism.
21
+
22
+ <!-- body -->
23
+
24
+ ## CRI Pod & Container Metrics
25
+
26
+ With ` PodAndContainerStatsFromCRI ` enabled, the kubelet polls the underlying container
27
+ runtime for pod and container stats instead of inspecting the host system directly using cAdvisor.
28
+ The benefits of relying on the container runtime for this information as opposed to direct
29
+ collection with cAdvisor include:
30
+
31
+ - Potential improved performance if the container runtime already collects this information
32
+ during normal operations. In this case, the data can be re-used instead of being aggregated
33
+ again by the kubelet.
34
+
35
+ - It further decouples the kubelet and the container runtime allowing collection of metrics for
36
+ container runtimes that don't run processes directly on the host with kubelet where they are
37
+ observable by cAdvisor (for example: container runtimes that use virtualization).
38
+
Original file line number Diff line number Diff line change @@ -37,17 +37,11 @@ kubelet endpoint, and not `/stats/summary`.
37
37
## Summary metrics API source {#summary-api-source}
38
38
39
39
By default, Kubernetes fetches node summary metrics data using an embedded
40
- [ cAdvisor] ( https://github.com/google/cadvisor ) that runs within the kubelet.
41
-
42
- ## Summary API data via CRI {#pod-and-container-stats-from-cri}
43
-
44
- {{< feature-state for_k8s_version="v1.23" state="alpha" >}}
45
-
46
- If you enable the ` PodAndContainerStatsFromCRI `
47
- [ feature gate] ( /docs/reference/command-line-tools-reference/feature-gates/ ) in your
48
- cluster, and you use a container runtime that supports statistics access via
40
+ [ cAdvisor] ( https://github.com/google/cadvisor ) that runs within the kubelet. If you
41
+ enable the ` PodAndContainerStatsFromCRI ` [ feature gate] ( /docs/reference/command-line-tools-reference/feature-gates/ )
42
+ in your cluster, and you use a container runtime that supports statistics access via
49
43
{{< glossary_tooltip term_id="cri" text="Container Runtime Interface">}} (CRI), then
50
- the kubelet fetches Pod- and container-level metric data using CRI, and not via cAdvisor.
44
+ the kubelet [ fetches Pod- and container-level metric data using CRI] ( /docs/reference/instrumentation/cri-pod-container-metrics ) , and not via cAdvisor.
51
45
52
46
## {{% heading "whatsnext" %}}
53
47
Original file line number Diff line number Diff line change @@ -14,4 +14,4 @@ Kubernetes documentation, including:
14
14
15
15
* [ Node Metrics Data] ( /docs/reference/instrumentation/node-metrics ) .
16
16
17
-
17
+ * [ CRI Pod & Container Metrics ] ( /docs/reference/instrumentation/cri-pod-container-metrics ) .
You can’t perform that action at this time.
0 commit comments