Skip to content

Commit 938c368

Browse files
committed
[zh] sync resource-metrics-pipeline.md
1 parent 4af53e7 commit 938c368

File tree

1 file changed

+20
-56
lines changed

1 file changed

+20
-56
lines changed

content/zh-cn/docs/tasks/debug/debug-cluster/resource-metrics-pipeline.md

Lines changed: 20 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ command.
3535
包括 CPU 和内存的指标。如果将 Metrics API 部署到集群中,
3636
那么 Kubernetes API 的客户端就可以查询这些信息,并且可以使用 Kubernetes 的访问控制机制来管理权限。
3737

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)
4040
使用 metrics API 中的数据调整工作负载副本和资源,以满足客户需求。
4141

4242
你也可以通过 [`kubectl top`](/docs/reference/generated/kubectl/kubectl-commands#top) 命令来查看资源指标。
@@ -51,8 +51,9 @@ the simpler Metrics API by deploying a second
5151
that uses the _Custom Metrics API_.
5252
-->
5353
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 的补充。
5657
{{< /note >}}
5758

5859
<!--
@@ -62,18 +63,18 @@ Figure 1 illustrates the architecture of the resource metrics pipeline.
6263

6364
{{< mermaid >}}
6465
flowchart RL
65-
subgraph cluster[Cluster]
66+
subgraph cluster[集群]
6667
direction RL
6768
S[ <br><br> ]
6869
A[Metrics-<br>Server]
69-
subgraph B[Nodes]
70+
subgraph B[节点]
7071
direction TB
7172
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
7576
end
76-
L[API<br>server]
77+
L[API<br>服务器]
7778
W[HPA]
7879
C ---->|Summary<br>API| A -->|metrics<br>API| L --> W
7980
end
@@ -143,9 +144,8 @@ autoscaler components.
143144
144145
Here is an example of the Metrics API request for a `minikube` node piped through `jq` for easier
145146
reading:
146-
147147
-->
148-
## Metrics API {#the-metrics-api}
148+
## Metrics API {#metrics-api}
149149

150150
{{< feature-state for_k8s_version="1.8" state="beta" >}}
151151

@@ -194,7 +194,6 @@ Sample response:
194194
Here is an example of the Metrics API request for a `kube-scheduler-minikube` pod contained in the
195195
`kube-system` namespace and piped through `jq` for easier reading:
196196
-->
197-
198197
下面是一个 `kube-system` 命名空间中的 `kube-scheduler-minikube` Pod 的 Metrics API 请求示例,
199198
通过 `jq` 管道处理以便于阅读:
200199

@@ -250,7 +249,6 @@ To learn more about the Metrics API, see [resource metrics API design](https://g
250249
the [metrics-server repository](https://github.com/kubernetes-sigs/metrics-server) and the
251250
[resource metrics API](https://github.com/kubernetes/metrics#resource-metrics-api).
252251
-->
253-
254252
Metrics API 在 [k8s.io/metrics](https://github.com/kubernetes/metrics) 代码库中定义。
255253
你必须启用 [API 聚合层](/zh-cn/docs/tasks/extend-kubernetes/configure-aggregation-layer/)并为
256254
`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) 代码
260258
[metrics-server 代码库](https://github.com/kubernetes-sigs/metrics-server)
261259
[Resource Metrics API](https://github.com/kubernetes/metrics#resource-metrics-api)
262260

261+
{{< note >}}
263262
<!--
264263
You must deploy the metrics-server or alternative adapter that serves the Metrics API to be able
265264
to access it.
266265
-->
267-
{{< note >}}
268266
你必须部署提供 Metrics API 服务的 metrics-server 或其他适配器才能访问它。
269267
{{< /note >}}
270268

@@ -364,6 +362,8 @@ metrics-server 调用 [kubelet](/zh-cn/docs/reference/command-line-tools-referen
364362
* 版本 v0.6.0+ 中,使用指标资源端点 `/metrics/resource`
365363
* 旧版本中使用 Summary API 端点 `/stats/summary`
366364

365+
## {{% heading "whatsnext" %}}
366+
367367
<!--
368368
To learn more about the metrics-server, see the
369369
[metrics-server repository](https://github.com/kubernetes-sigs/metrics-server).
@@ -376,7 +376,6 @@ You can also check out the following:
376376
* [metrics-server releases](https://github.com/kubernetes-sigs/metrics-server/releases)
377377
* [Horizontal Pod Autoscaling](/docs/tasks/run-application/horizontal-pod-autoscale/)
378378
-->
379-
380379
了解更多 metrics-server,参阅 [metrics-server 代码库](https://github.com/kubernetes-sigs/metrics-server)
381380

382381
你还可以查看以下内容:
@@ -385,46 +384,11 @@ You can also check out the following:
385384
* [metrics-server FAQ](https://github.com/kubernetes-sigs/metrics-server/blob/master/FAQ.md)
386385
* [metrics-server known issues](https://github.com/kubernetes-sigs/metrics-server/blob/master/KNOWN_ISSUES.md)
387386
* [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/)
414388

415389
<!--
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).
428392
-->
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

Comments
 (0)