Skip to content

Commit 97a882c

Browse files
authored
Merge pull request #25135 from tengqm/zh-sync-resource-metrics-pipeline
[zh] Sync tasks/debug-application-cluster/resource-metrics-pipeline.md
2 parents 53a7fb6 + 5abd960 commit 97a882c

File tree

1 file changed

+44
-32
lines changed

1 file changed

+44
-32
lines changed

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

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,41 +14,42 @@ content_type: concept
1414

1515
<!--
1616
Resource usage metrics, such as container CPU and memory usage,
17-
are available in Kubernetes through the Metrics API. These metrics can be either accessed directly
18-
by user, for example by using `kubectl top` command, or used by a controller in the cluster, e.g.
17+
are available in Kubernetes through the Metrics API. These metrics can be accessed either directly
18+
by the user with the `kubectl top` command, or by a controller in the cluster, for example
1919
Horizontal Pod Autoscaler, to make decisions.
2020
-->
2121
资源使用指标,例如容器 CPU 和内存使用率,可通过 Metrics API 在 Kubernetes 中获得。
22-
这些指标可以直接被用户访问,比如使用 `kubectl top` 命令行,或者这些指标由集群中的控制器使用,
23-
例如,Horizontal Pod Autoscaler,使用这些指标来做决策
22+
这些指标可以直接被用户访问,比如使用 `kubectl top` 命令行,或者被集群中的控制器
23+
(例如 Horizontal Pod Autoscalers) 使用来做决策
2424

2525
<!-- body -->
2626

2727
<!--
2828
## The Metrics API
2929
30-
Through the Metrics API you can get the amount of resource currently used
30+
Through the Metrics API, you can get the amount of resource currently used
3131
by a given node or a given pod. This API doesn't store the metric values,
32-
so it's not possible for example to get the amount of resources used by a
32+
so it's not possible, for example, to get the amount of resources used by a
3333
given node 10 minutes ago.
3434
-->
3535
## Metrics API {#the-metrics-api}
3636

3737
通过 Metrics API,你可以获得指定节点或 Pod 当前使用的资源量。
38-
此 API 不存储指标值,因此想要获取某个指定节点 10 分钟前的资源使用量是不可能的。
38+
此 API 不存储指标值,因此想要获取某个指定节点 10 分钟前的
39+
资源使用量是不可能的。
3940

4041
<!--
4142
The API is no different from any other API:
4243
-->
4344
此 API 与其他 API 没有区别:
4445

4546
<!--
46-
- it is discoverable through the same endpoint as the other Kubernetes APIs under `/apis/metrics.k8s.io/` path
47-
- it offers the same security, scalability and reliability guarantees
47+
- it is discoverable through the same endpoint as the other Kubernetes APIs under the path: `/apis/metrics.k8s.io/`
48+
- it offers the same security, scalability, and reliability guarantees
4849
-->
49-
- 此 API 和其它 Kubernetes API 一起位于同一端点(endpoint)之下,是可发现的
50+
- 此 API 和其它 Kubernetes API 一起位于同一端点(endpoint)之下且可发现
5051
路径为 `/apis/metrics.k8s.io/`
51-
- 它提供相同的安全性、可扩展性和可靠性保证
52+
- 它具有相同的安全性、可扩展性和可靠性保证
5253

5354
<!--
5455
The API is defined in [k8s.io/metrics](https://github.com/kubernetes/metrics/blob/master/pkg/apis/metrics/v1beta1/types.go)
@@ -69,7 +70,11 @@ Metrics API 需要在集群中部署 Metrics Server。否则它将不可用。
6970
7071
### CPU
7172
72-
CPU is reported as the average usage, in [CPU cores](/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu), over a period of time. This value is derived by taking a rate over a cumulative CPU counter provided by the kernel (in both Linux and Windows kernels). The kubelet chooses the window for the rate calculation.
73+
CPU is reported as the average usage, in
74+
[CPU cores](/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu),
75+
over a period of time. This value is derived by taking a rate over a cumulative CPU counter
76+
provided by the kernel (in both Linux and Windows kernels).
77+
The kubelet chooses the window for the rate calculation.
7378
-->
7479
## 度量资源用量 {#measuring-resource-usage}
7580

@@ -80,6 +85,15 @@ CPU 用量按其一段时间内的平均值统计,单位为
8085
此度量值通过在内核(包括 Linux 和 Windows)提供的累积 CPU 计数器乘以一个系数得到。
8186
`kubelet` 组件负责选择计算系数所使用的窗口大小。
8287

88+
<!--
89+
### Memory
90+
91+
Memory is reported as the working set, in bytes, at the instant the metric was collected.
92+
In an ideal world, the "working set" is the amount of memory in-use that cannot be freed under memory pressure.
93+
However, calculation of the working set varies by host OS, and generally makes heavy use of heuristics to produce an estimate.
94+
It includes all anonymous (non-file-backed) memory since Kubernetes does not support swap.
95+
The metric typically also includes some cached (file-backed) memory, because the host OS cannot always reclaim such pages.
96+
-->
8397
### 内存 {#memory}
8498

8599
内存用量按工作集(Working Set)的大小字节数统计,其数值为收集度量值的那一刻的内存用量。
@@ -94,37 +108,35 @@ CPU 用量按其一段时间内的平均值统计,单位为
94108
<!--
95109
## Metrics Server
96110
97-
[Metrics Server](https://github.com/kubernetes-incubator/metrics-server) is a cluster-wide aggregator of resource usage data.
98-
Starting from Kubernetes 1.8 it's deployed by default in clusters created by `kube-up.sh` script
111+
[Metrics Server](https://github.com/kubernetes-sigs/metrics-server) is a cluster-wide aggregator of resource usage data.
112+
By default, it is deployed in clusters created by `kube-up.sh` script
99113
as a Deployment object. If you use a different Kubernetes setup mechanism you can deploy it using the provided
100-
[deployment yamls](https://github.com/kubernetes-incubator/metrics-server/tree/master/deploy).
101-
It's supported in Kubernetes 1.7+ (see details below).
114+
[deployment components.yaml](https://github.com/kubernetes-sigs/metrics-server/releases) file.
102115
-->
103116
## Metrics 服务器 {#metrics-server}
104117

105-
[Metrics 服务器](https://github.com/kubernetes-incubator/metrics-server)是集群范围资源使用数据的聚合器。
106-
在由 `kube-up.sh` 脚本创建的集群中默认会以 Deployment 的形式被部署。
118+
[Metrics 服务器](https://github.com/kubernetes-sings/metrics-server)
119+
是集群范围资源用量数据的聚合器。
120+
默认情况下,在由 `kube-up.sh` 脚本创建的集群中会以 Deployment 的形式被部署。
107121
如果你使用其他 Kubernetes 安装方法,则可以使用提供的
108-
[deployment yamls](https://github.com/kubernetes-incubator/metrics-server/tree/master/deploy)
122+
[部署组件 components.yaml](https://github.com/kubernetes-incubator/metrics-server/tree/master/deploy)
109123
来部署。
110124

111125
<!--
112-
Metric server collects metrics from the Summary API, exposed by [Kubelet](/docs/admin/kubelet/) on each node.
126+
Metric server collects metrics from the Summary API, exposed by
127+
[Kubelet](/docs/reference/command-line-tools-reference/kubelet/) on each node, and is registered with the main API server via
128+
[Kubernetes aggregator](/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/).
113129
-->
114-
Metric server 从每个节点上的 [Kubelet](/zh/docs/reference/command-line-tools-reference/kubelet/)
130+
Metric 服务器从每个节点上的 [kubelet](/zh/docs/reference/command-line-tools-reference/kubelet/)
115131
公开的 Summary API 中采集指标信息。
132+
该 API 通过
133+
[Kubernetes 聚合器](/zh/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/)
134+
注册到主 API 服务器上。
116135

117136
<!--
118-
Metrics Server registered in the main API server through
119-
[Kubernetes aggregator](/docs/concepts/api-extension/apiserver-aggregation/),
120-
which was introduced in Kubernetes 1.7.
121-
-->
122-
Metrics 服务器通过
123-
[Kubernetes 聚合器](/zh/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/)
124-
注册到主 API 服务器。
125-
126-
<!--
127-
Learn more about the metrics server in [the design doc](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/instrumentation/metrics-server.md).
137+
Learn more about the metrics server in
138+
[the design doc](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/instrumentation/metrics-server.md).
128139
-->
129-
[设计文档](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/instrumentation/metrics-server.md)中可以了解到有关 Metrics 服务器的更多信息。
140+
[设计文档](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/instrumentation/metrics-server.md)
141+
中可以了解到有关 Metrics 服务器的更多信息。
130142

0 commit comments

Comments
 (0)