Skip to content

Commit e1b557e

Browse files
jaiclaude
andcommitted
Fix dead link in node-metrics.md by creating kubelet Summary API documentation
This commit addresses issue #51177 by: 1. Creating a new documentation page for the kubelet Summary API at /docs/reference/instrumentation/kubelet-summary-api.md 2. Updating the broken links in node-metrics.md to point to the new page instead of the non-existent /docs/reference/config-api/kubelet-stats.v1alpha1/ The new page provides comprehensive documentation about: - How to access the Summary API - The structure of the API response - Available metrics at node, pod, and container levels - Common use cases and limitations This approach follows Option 2 from the issue discussion, creating proper documentation for the kubelet node stats and pod stats API rather than just removing the link. Fixes #51177 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 110f2cb commit e1b557e

File tree

2 files changed

+143
-2
lines changed

2 files changed

+143
-2
lines changed
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
---
2+
title: Kubelet Summary API
3+
content_type: reference
4+
weight: 55
5+
description: >-
6+
The kubelet Summary API for accessing node, pod, and container metrics.
7+
---
8+
9+
<!-- overview -->
10+
11+
The kubelet exposes a Summary API at the `/stats/summary` endpoint that provides
12+
aggregated metrics for nodes, pods, containers, and volumes. This API serves as a
13+
primary source for resource usage data collected by the kubelet.
14+
15+
<!-- body -->
16+
17+
## Accessing the Summary API
18+
19+
You can access the Summary API through the Kubernetes API server as a proxy:
20+
21+
```shell
22+
kubectl get --raw "/api/v1/nodes/<NODE_NAME>/proxy/stats/summary"
23+
```
24+
25+
Replace `<NODE_NAME>` with the name of the node you want to query.
26+
27+
Alternatively, if you have direct access to the kubelet port (typically 10250),
28+
you can query it directly:
29+
30+
```shell
31+
curl -k https://<NODE_IP>:10250/stats/summary
32+
```
33+
34+
{{< note >}}
35+
Direct access to the kubelet requires proper authentication and is typically
36+
restricted in production environments. Using `kubectl proxy` is the recommended
37+
approach.
38+
{{< /note >}}
39+
40+
## API Response Structure
41+
42+
The Summary API returns a JSON object containing comprehensive metrics organized
43+
hierarchically:
44+
45+
```json
46+
{
47+
"node": {
48+
"nodeName": "node-1",
49+
"systemContainers": [...],
50+
"startTime": "2024-01-01T00:00:00Z",
51+
"cpu": {...},
52+
"memory": {...},
53+
"network": {...},
54+
"fs": {...},
55+
"runtime": {...},
56+
"rlimit": {...}
57+
},
58+
"pods": [
59+
{
60+
"podRef": {
61+
"name": "pod-name",
62+
"namespace": "namespace",
63+
"uid": "pod-uid"
64+
},
65+
"startTime": "2024-01-01T00:00:00Z",
66+
"containers": [...],
67+
"cpu": {...},
68+
"memory": {...},
69+
"network": {...},
70+
"volume": [...],
71+
"ephemeral-storage": {...},
72+
"process_stats": {...}
73+
}
74+
]
75+
}
76+
```
77+
78+
## Metrics Categories
79+
80+
### Node-Level Metrics
81+
82+
- **CPU**: Usage statistics including total usage and cumulative usage
83+
- **Memory**: Working set, available memory, usage, RSS, and page faults
84+
- **Network**: Interface statistics with RX/TX bytes and errors
85+
- **Filesystem**: Capacity, available space, and usage for the root filesystem
86+
- **Runtime**: Container runtime information and image filesystem stats
87+
- **Rlimit**: System resource limits
88+
89+
### Pod-Level Metrics
90+
91+
- **CPU**: Aggregate CPU usage for all containers in the pod
92+
- **Memory**: Aggregate memory statistics for the pod
93+
- **Network**: Pod-level network I/O statistics
94+
- **Volume**: Usage statistics for each volume mounted in the pod
95+
- **Ephemeral Storage**: Total filesystem usage for containers and emptyDir volumes
96+
97+
### Container-Level Metrics
98+
99+
- **CPU**: Per-container CPU usage and cumulative usage
100+
- **Memory**: Per-container memory statistics
101+
- **Rootfs**: Container writable layer usage
102+
- **Logs**: Container logs storage usage
103+
- **Accelerators**: GPU and other accelerator metrics (if applicable)
104+
- **User-defined metrics**: Custom metrics exposed by containers
105+
106+
## Data Sources
107+
108+
By default, the kubelet collects these metrics using an embedded
109+
[cAdvisor](https://github.com/google/cadvisor). However, when the
110+
`PodAndContainerStatsFromCRI` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
111+
is enabled, the kubelet can fetch pod and container metrics directly from the
112+
[Container Runtime Interface (CRI)](/docs/concepts/architecture/cri/).
113+
114+
## Common Use Cases
115+
116+
1. **Monitoring Solutions**: Tools like metrics-server (prior to v0.6.x) use the
117+
Summary API to collect cluster-wide metrics.
118+
119+
2. **Debugging Resource Usage**: Administrators can query the API to understand
120+
actual resource consumption versus configured requests and limits.
121+
122+
3. **Custom Autoscaling**: The Summary API can provide data for custom autoscaling
123+
solutions or vertical pod autoscaling.
124+
125+
4. **Capacity Planning**: Historical data from the Summary API helps in understanding
126+
resource utilization patterns.
127+
128+
## Limitations and Considerations
129+
130+
- Starting with metrics-server v0.6.x, the preferred endpoint is `/metrics/resource`
131+
instead of `/stats/summary`.
132+
- The Summary API provides point-in-time data and doesn't store historical metrics.
133+
- Access to the Summary API requires appropriate RBAC permissions when accessed
134+
through the API server.
135+
- The data format is specific to Kubernetes and differs from Prometheus-style metrics.
136+
137+
## {{% heading "whatsnext" %}}
138+
139+
- Learn more about [Node Metrics](/docs/reference/instrumentation/node-metrics/)
140+
- Explore [CRI Pod & Container Metrics](/docs/reference/instrumentation/cri-pod-container-metrics/)
141+
- Read about [Kubernetes Metrics](/docs/concepts/cluster-administration/system-metrics/)

content/en/docs/reference/instrumentation/node-metrics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: >-
1010
The [kubelet](/docs/reference/command-line-tools-reference/kubelet/)
1111
gathers metric statistics at the node, volume, pod and container level,
1212
and emits this information in the
13-
[Summary API](/docs/reference/config-api/kubelet-stats.v1alpha1/).
13+
[Summary API](/docs/reference/instrumentation/kubelet-summary-api/).
1414

1515
You can send a proxied request to the stats summary API via the
1616
Kubernetes API server.
@@ -50,7 +50,7 @@ the kubelet [fetches Pod- and container-level metric data using CRI](/docs/refer
5050
As an alpha feature, Kubernetes lets you configure kubelet to collect Linux kernel
5151
[Pressure Stall Information](https://docs.kernel.org/accounting/psi.html)
5252
(PSI) for CPU, memory and IO usage. The information is collected at node, pod and container level.
53-
See [Summary API](/docs/reference/config-api/kubelet-stats.v1alpha1/) for detailed schema.
53+
See [Summary API](/docs/reference/instrumentation/kubelet-summary-api/) for detailed schema.
5454
You must enable the `KubeletPSI` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
5555
to use this feature. The information is also exposed in
5656
[Prometheus metrics](/docs/concepts/cluster-administration/system-metrics#psi-metrics).

0 commit comments

Comments
 (0)