@@ -35,8 +35,8 @@ command.
35
35
包括 CPU 和内存的指标。如果将 Metrics API 部署到集群中,
36
36
那么 Kubernetes API 的客户端就可以查询这些信息,并且可以使用 Kubernetes 的访问控制机制来管理权限。
37
37
38
- [ HorizontalPodAutoscaler] ( /zh-cn/docs/tasks/run-application/horizontal-pod-autoscale/ ) (HPA) 和
39
- [ VerticalPodAutoscaler] ( https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler#readme ) (VPA)
38
+ [ HorizontalPodAutoscaler] ( /zh-cn/docs/tasks/run-application/horizontal-pod-autoscale/ ) (HPA) 和
39
+ [ VerticalPodAutoscaler] ( https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler#readme ) (VPA)
40
40
使用 metrics API 中的数据调整工作负载副本和资源,以满足客户需求。
41
41
42
42
你也可以通过 [ ` kubectl top ` ] ( /docs/reference/generated/kubectl/kubectl-commands#top ) 命令来查看资源指标。
@@ -51,8 +51,9 @@ the simpler Metrics API by deploying a second
51
51
that uses the _Custom Metrics API_.
52
52
-->
53
53
Metrics API 及其启用的指标管道仅提供最少的 CPU 和内存指标,以启用使用 HPA 和/或 VPA 的自动扩展。
54
- 如果你想提供更完整的指标集,你可以通过部署使用 ** Custom Metrics API** 的第二个
55
- [ 指标管道] ( /zh-cn/docs/tasks/debug/debug-cluster/resource-usage-monitoring/#full-metrics-pipeline ) 来作为简单的 Metrics API 的补充。
54
+ 如果你想提供更完整的指标集,你可以通过部署使用 ** Custom Metrics API**
55
+ 的第二个[ 指标管道] ( /zh-cn/docs/tasks/debug/debug-cluster/resource-usage-monitoring/#full-metrics-pipeline ) 来作为简单的
56
+ Metrics API 的补充。
56
57
{{< /note >}}
57
58
58
59
<!--
@@ -62,18 +63,18 @@ Figure 1 illustrates the architecture of the resource metrics pipeline.
62
63
63
64
{{< mermaid >}}
64
65
flowchart RL
65
- subgraph cluster[ Cluster ]
66
+ subgraph cluster[ 集群 ]
66
67
direction RL
67
68
S[ <br ><br > ]
68
69
A[ Metrics-<br >Server]
69
- subgraph B[ Nodes ]
70
+ subgraph B[ 节点 ]
70
71
direction TB
71
72
D[ cAdvisor] --> C[ kubelet]
72
- E[ Container <br >runtime ] --> D
73
- E1[ Container <br >runtime ] --> D
74
- P[ pod data ] -.- C
73
+ E[ 容器 <br >运行时 ] --> D
74
+ E1[ 容器 <br >运行时 ] --> D
75
+ P[ Pod 数据 ] -.- C
75
76
end
76
- L[ API<br >server ]
77
+ L[ API<br >服务器 ]
77
78
W[ HPA]
78
79
C ---->|Summary<br >API| A -->|metrics<br >API| L --> W
79
80
end
@@ -143,9 +144,8 @@ autoscaler components.
143
144
144
145
Here is an example of the Metrics API request for a `minikube` node piped through `jq` for easier
145
146
reading:
146
-
147
147
-->
148
- ## Metrics API {#the- metrics-api}
148
+ ## Metrics API {#metrics-api}
149
149
150
150
{{< feature-state for_k8s_version="1.8" state="beta" >}}
151
151
@@ -194,7 +194,6 @@ Sample response:
194
194
Here is an example of the Metrics API request for a `kube-scheduler-minikube` pod contained in the
195
195
`kube-system` namespace and piped through `jq` for easier reading:
196
196
-->
197
-
198
197
下面是一个 ` kube-system ` 命名空间中的 ` kube-scheduler-minikube ` Pod 的 Metrics API 请求示例,
199
198
通过 ` jq ` 管道处理以便于阅读:
200
199
@@ -250,7 +249,6 @@ To learn more about the Metrics API, see [resource metrics API design](https://g
250
249
the [metrics-server repository](https://github.com/kubernetes-sigs/metrics-server) and the
251
250
[resource metrics API](https://github.com/kubernetes/metrics#resource-metrics-api).
252
251
-->
253
-
254
252
Metrics API 在 [ k8s.io/metrics] ( https://github.com/kubernetes/metrics ) 代码库中定义。
255
253
你必须启用 [ API 聚合层] ( /zh-cn/docs/tasks/extend-kubernetes/configure-aggregation-layer/ ) 并为
256
254
` metrics.k8s.io ` API 注册一个 [ APIService] ( /zh-cn/docs/reference/kubernetes-api/cluster-resources/api-service-v1/ ) 。
@@ -260,11 +258,11 @@ Metrics API 在 [k8s.io/metrics](https://github.com/kubernetes/metrics) 代码
260
258
[ metrics-server 代码库] ( https://github.com/kubernetes-sigs/metrics-server ) 和
261
259
[ Resource Metrics API] ( https://github.com/kubernetes/metrics#resource-metrics-api ) 。
262
260
261
+ {{< note >}}
263
262
<!--
264
263
You must deploy the metrics-server or alternative adapter that serves the Metrics API to be able
265
264
to access it.
266
265
-->
267
- {{< note >}}
268
266
你必须部署提供 Metrics API 服务的 metrics-server 或其他适配器才能访问它。
269
267
{{< /note >}}
270
268
@@ -364,6 +362,8 @@ metrics-server 调用 [kubelet](/zh-cn/docs/reference/command-line-tools-referen
364
362
* 版本 v0.6.0+ 中,使用指标资源端点 ` /metrics/resource `
365
363
* 旧版本中使用 Summary API 端点 ` /stats/summary `
366
364
365
+ ## {{% heading "whatsnext" %}}
366
+
367
367
<!--
368
368
To learn more about the metrics-server, see the
369
369
[metrics-server repository](https://github.com/kubernetes-sigs/metrics-server).
@@ -376,7 +376,6 @@ You can also check out the following:
376
376
* [metrics-server releases](https://github.com/kubernetes-sigs/metrics-server/releases)
377
377
* [Horizontal Pod Autoscaling](/docs/tasks/run-application/horizontal-pod-autoscale/)
378
378
-->
379
-
380
379
了解更多 metrics-server,参阅 [ metrics-server 代码库] ( https://github.com/kubernetes-sigs/metrics-server ) 。
381
380
382
381
你还可以查看以下内容:
@@ -385,46 +384,11 @@ You can also check out the following:
385
384
* [ metrics-server FAQ] ( https://github.com/kubernetes-sigs/metrics-server/blob/master/FAQ.md )
386
385
* [ metrics-server known issues] ( https://github.com/kubernetes-sigs/metrics-server/blob/master/KNOWN_ISSUES.md )
387
386
* [ metrics-server releases] ( https://github.com/kubernetes-sigs/metrics-server/releases )
388
- * [ Horizontal Pod Autoscaling] ( /zh-cn/docs/tasks/run-application/horizontal-pod-autoscale/ )
389
-
390
- <!--
391
- ### Summary API source
392
-
393
- The [kubelet](/docs/reference/command-line-tools-reference/kubelet/) gathers stats at the node,
394
- volume, pod and container level, and emits this information in
395
- the [Summary API](https://github.com/kubernetes/kubernetes/blob/7d309e0104fedb57280b261e5677d919cb2a0e2d/staging/src/k8s.io/kubelet/pkg/apis/stats/v1alpha1/types.go)
396
- for consumers to read.
397
- -->
398
-
399
- ### Summary API 来源 {#summary-api-source}
400
-
401
- [ kubelet] ( /zh-cn/docs/reference/command-line-tools-reference/kubelet/ ) 在节点、卷、Pod 和容器级别收集统计信息,
402
- 并在 [ Summary API] ( https://github.com/kubernetes/kubernetes/blob/7d309e0104fedb57280b261e5677d919cb2a0e2d/staging/src/k8s.io/kubelet/pkg/apis/stats/v1alpha1/types.go )
403
- 中提供它们的统计信息供消费者阅读。
404
-
405
- <!--
406
- Here is an example of a Summary API request for a `minikube` node:
407
- -->
408
-
409
- 下面是一个 ` minikube ` 节点的 Summary API 请求示例:
410
-
411
- ``` shell
412
- kubectl get --raw " /api/v1/nodes/minikube/proxy/stats/summary"
413
- ```
387
+ * [ 水平自动扩缩] ( /zh-cn/docs/tasks/run-application/horizontal-pod-autoscale/ )
414
388
415
389
<!--
416
- Here is the same API call using `curl`:
417
- -->
418
- 这是使用 ` curl ` 来执行的相同 API 调用:
419
-
420
- ``` shell
421
- curl http://localhost:8080/api/v1/nodes/minikube/proxy/stats/summary
422
- ```
423
-
424
- {{< note >}}
425
- <!--
426
- The summary API `/stats/summary` endpoint will be replaced by the `/metrics/resource` endpoint
427
- beginning with metrics-server 0.6.x.
390
+ To learn about how the kubelet serves node metrics, and how you can access those via
391
+ the Kubernetes API, read [Node Metrics Data](/docs/reference/instrumentation/node-metrics).
428
392
-->
429
- 从 metrics-server 0.6.x 开始,Summary API ` /stats/summary ` 端点被 ` /metrics/resource ` 端点替换。
430
- {{< /note >}}
393
+ 若要了解 kubelet 如何提供节点指标以及你可以如何通过 Kubernetes API 访问这些指标,
394
+ 请阅读 [ 节点指标数据 ] ( /zh-cn/docs/reference/instrumentation/node-metrics ) 。
0 commit comments