Skip to content

Commit bc557bb

Browse files
authored
Merge pull request #35308 from Sea-n/zh-links-eviction
[zh-cn] Fix link for runtime-class
2 parents 526f61e + 35308de commit bc557bb

File tree

2 files changed

+50
-45
lines changed

2 files changed

+50
-45
lines changed

content/zh-cn/blog/_posts/2018-10-10-runtimeclass.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ date: 2018-10-10
1919
Kubernetes originally launched with support for Docker containers running native applications on a Linux host. Starting with [rkt](https://kubernetes.io/blog/2016/07/rktnetes-brings-rkt-container-engine-to-kubernetes/) in Kubernetes 1.3 more runtimes were coming, which lead to the development of the [Container Runtime Interface](https://kubernetes.io/blog/2016/12/container-runtime-interface-cri-in-kubernetes/) (CRI). Since then, the set of alternative runtimes has only expanded: projects like [Kata Containers](https://katacontainers.io/) and [gVisor](https://github.com/google/gvisor) were announced for stronger workload isolation, and Kubernetes' Windows support has been [steadily progressing](https://kubernetes.io/blog/2018/01/kubernetes-v19-beta-windows-support/).
2020
-->
2121
Kubernetes 最初是为了支持在 Linux 主机上运行本机应用程序的 Docker 容器而创建的。
22-
从 Kubernetes 1.3中的 [rkt](https://kubernetes.io/blog/2016/07/rktnetes-brings-rkt-container-engine-to-kubernetes/) 开始,更多的运行时间开始涌现,
22+
从 Kubernetes 1.3 中的 [rkt](https://kubernetes.io/blog/2016/07/rktnetes-brings-rkt-container-engine-to-kubernetes/) 开始,更多的运行时间开始涌现,
2323
这导致了[容器运行时接口(Container Runtime Interface)](https://kubernetes.io/blog/2016/12/container-runtime-interface-cri-in-kubernetes/)(CRI)的开发。
2424
从那时起,备用运行时集合越来越大:
2525
为了加强工作负载隔离,[Kata Containers](https://katacontainers.io/)[gVisor](https://github.com/google/gvisor) 等项目被发起,
26-
并且 Kubernetes 对 Windows 的支持正在 [稳步发展](https://kubernetes.io/blog/2018/01/kubernetes-v19-beta-windows-support/)
26+
并且 Kubernetes 对 Windows 的支持正在[稳步发展](https://kubernetes.io/blog/2018/01/kubernetes-v19-beta-windows-support/)
2727

2828
<!--
2929
With runtimes targeting so many different use cases, a clear need for mixed runtimes in a cluster arose. But all these different ways of running containers have brought a new set of problems to deal with:
@@ -56,7 +56,7 @@ With runtimes targeting so many different use cases, a clear need for mixed runt
5656
RuntimeClass was recently introduced as an alpha feature in Kubernetes 1.12. The initial implementation focuses on providing a runtime selection API, and paves the way to address the other open problems.
5757
-->
5858
最近,RuntimeClass 在 Kubernetes 1.12 中作为 alpha 功能引入。
59-
最初的实现侧重于提供运行时选择 API ,并为解决其他未解决的问题铺平道路。
59+
最初的实现侧重于提供运行时选择 API,并为解决其他未解决的问题铺平道路。
6060

6161
<!--
6262
The RuntimeClass resource represents a container runtime supported in a Kubernetes cluster. The cluster provisioner sets up, configures, and defines the concrete runtimes backing the RuntimeClass. In its current form, a RuntimeClassSpec holds a single field, the **RuntimeHandler**. The RuntimeHandler is interpreted by the CRI implementation running on a node, and mapped to the actual runtime configuration. Meanwhile the PodSpec has been expanded with a new field, **RuntimeClassName**, which names the RuntimeClass that should be used to run the pod.
@@ -81,14 +81,14 @@ Kubernetes 资源模型期望 Pod 中的容器之间可以共享某些资源。
8181
## 下一步是什么?
8282

8383
<!--
84-
The RuntimeClass resource is an important foundation for surfacing runtime properties to the control plane. For example, to implement scheduler support for clusters with heterogeneous nodes supporting different runtimes, we might add [NodeAffinity](/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) terms to the RuntimeClass definition. Another area to address is managing the variable resource requirements to run pods of different runtimes. The [Pod Overhead proposal](https://docs.google.com/document/d/1EJKT4gyl58-kzt2bnwkv08MIUZ6lkDpXcxkHqCvvAp4/preview) was an early take on this that aligns nicely with the RuntimeClass design, and may be pursued further.
84+
The RuntimeClass resource is an important foundation for surfacing runtime properties to the control plane. For example, to implement scheduler support for clusters with heterogeneous nodes supporting different runtimes, we might add [NodeAffinity](/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) terms to the RuntimeClass definition. Another area to address is managing the variable resource requirements to run pods of different runtimes. The [Pod Overhead proposal](https://docs.google.com/document/d/1EJKT4gyl58-kzt2bnwkv08MIUZ6lkDpXcxkHqCvvAp4/preview) was an early take on this that aligns nicely with the RuntimeClass design, and may be pursued further.
8585
-->
8686
RuntimeClass 资源是将运行时属性显示到控制平面的重要基础。
8787
例如,要对具有支持不同运行时间的异构节点的集群实施调度程序支持,我们可以在 RuntimeClass 定义中添加
88-
[NodeAffinity](/zh-cn/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity)条件。
88+
[NodeAffinity](/zh-cn/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) 条件。
8989
另一个需要解决的领域是管理可变资源需求以运行不同运行时的 Pod。
90-
[Pod Overhead 提案](https://docs.google.com/document/d/1EJKT4gyl58-kzt2bnwkv08MIUZ6lkDpXcxkHqCvvAp4/preview)
91-
是一项较早的尝试,与 RuntimeClass 设计非常吻合,并且可能会进一步推广。
90+
[Pod Overhead 提案](https://docs.google.com/document/d/1EJKT4gyl58-kzt2bnwkv08MIUZ6lkDpXcxkHqCvvAp4/preview)是一项较早的尝试,与
91+
RuntimeClass 设计非常吻合,并且可能会进一步推广。
9292

9393
<!--
9494
Many other RuntimeClass extensions have also been proposed, and will be revisited as the feature continues to develop and mature. A few more extensions that are being considered include:
@@ -107,13 +107,13 @@ Many other RuntimeClass extensions have also been proposed, and will be revisite
107107
- 自动运行时或功能发现,支持无需手动配置的调度决策。
108108
- 标准化或一致的 RuntimeClass 名称,用于定义一组具有相同名称的 RuntimeClass 的集群应支持的属性。
109109
- 动态注册附加的运行时,因此用户可以在不停机的情况下在现有集群上安装新的运行时。
110-
- 根据 Pod 的要求“匹配” RuntimeClass。
110+
- 根据 Pod 的要求“匹配” RuntimeClass。
111111
例如,指定运行时属性并使系统与适当的 RuntimeClass 匹配,而不是通过名称显式分配 RuntimeClass。
112112

113113
<!--
114114
RuntimeClass will be under active development at least through 2019, and we’re excited to see the feature take shape, starting with the RuntimeClass alpha in Kubernetes 1.12.
115115
-->
116-
至少要到2019年,RuntimeClass 才会得到积极的开发,我们很高兴看到从 Kubernetes 1.12 中的 RuntimeClass alpha 开始,此功能得以形成。
116+
至少要到 2019 年,RuntimeClass 才会得到积极的开发,我们很高兴看到从 Kubernetes 1.12 中的 RuntimeClass alpha 开始,此功能得以形成。
117117

118118
<!--
119119
## Learn More
@@ -127,10 +127,9 @@ RuntimeClass will be under active development at least through 2019, and we’re
127127
- Join the discussions and help shape the future of RuntimeClass with the [SIG-Node community](https://github.com/kubernetes/community/tree/master/sig-node)
128128
-->
129129

130-
- 试试吧! 作为Alpha功能,还有一些其他设置步骤可以使用RuntimeClass。
131-
有关如何使其运行,请参考 [RuntimeClass文档](/zh-cn/docs/concepts/containers/runtime-class/#runtime-class)
132-
- 查看 [RuntimeClass Kubernetes 增强建议](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/runtime-class.md) 以获取更多细节设计细节。
133-
- [沙盒隔离级别决策](https://docs.google.com/document/d/1fe7lQUjYKR0cijRmSbH_y0_l3CYPkwtQa5ViywuNo8Q/preview)
134-
记录了最初使 RuntimeClass 成为 Pod 级别选项的思考过程。
135-
- 加入讨论,并通过 [SIG-Node社区](https://github.com/kubernetes/community/tree/master/sig-node) 帮助塑造 RuntimeClass 的未来。
136-
130+
- 试试吧!作为 Alpha 功能,还有一些其他设置步骤可以使用 RuntimeClass。
131+
有关如何使其运行,请参考 [RuntimeClass 文档](/zh-cn/docs/concepts/containers/runtime-class/#runtime-class)
132+
- 查看 [RuntimeClass Kubernetes 增强建议](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/runtime-class.md)以获取更多细节设计细节。
133+
- [沙盒隔离级别决策](https://docs.google.com/document/d/1fe7lQUjYKR0cijRmSbH_y0_l3CYPkwtQa5ViywuNo8Q/preview)记录了最初使
134+
RuntimeClass 成为 Pod 级别选项的思考过程。
135+
- 加入讨论,并通过 [SIG-Node 社区](https://github.com/kubernetes/community/tree/master/sig-node)帮助塑造 RuntimeClass 的未来。

content/zh-cn/docs/concepts/containers/runtime-class.md

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ weight: 20
1616

1717
{{< feature-state for_k8s_version="v1.20" state="stable" >}}
1818

19-
<!--
19+
<!--
2020
This page describes the RuntimeClass resource and runtime selection mechanism.
2121
2222
RuntimeClass is a feature for selecting the container runtime configuration. The container runtime
@@ -28,7 +28,7 @@ RuntimeClass 是一个用于选择容器运行时配置的特性,容器运行
2828

2929
<!-- body -->
3030

31-
<!--
31+
<!--
3232
## Motivation
3333
3434
You can set a different RuntimeClass between different Pods to provide a balance of
@@ -51,7 +51,7 @@ but with different settings.
5151
-->
5252
你还可以使用 RuntimeClass 运行具有相同容器运行时但具有不同设置的 Pod。
5353

54-
<!--
54+
<!--
5555
## Setup
5656
-->
5757

@@ -77,12 +77,12 @@ CRI implementation for how to configure.
7777
RuntimeClass 的配置依赖于 运行时接口(CRI)的实现。
7878
根据你使用的 CRI 实现,查阅相关的文档([下方](#cri-configuration))来了解如何配置。
7979

80+
{{< note >}}
8081
<!--
8182
RuntimeClass assumes a homogeneous node configuration across the cluster by default (which means
8283
that all nodes are configured the same way with respect to container runtimes). To support
83-
heterogenous node configurations, see [Scheduling](#scheduling) below.
84+
heterogeneous node configurations, see [Scheduling](#scheduling) below.
8485
-->
85-
{{< note >}}
8686
RuntimeClass 假设集群中的节点配置是同构的(换言之,所有的节点在容器运行时方面的配置是相同的)。
8787
如果需要支持异构节点,配置方法请参阅下面的 [调度](#scheduling)
8888
{{< /note >}}
@@ -102,7 +102,7 @@ the configuration. For each handler, create a corresponding RuntimeClass object.
102102
-->
103103
### 2. 创建相应的 RuntimeClass 资源
104104

105-
在上面步骤 1 中,每个配置都需要有一个用于标识配置的 `handler`
105+
在上面步骤 1 中,每个配置都需要有一个用于标识配置的 `handler`
106106
针对每个 handler 需要创建一个 RuntimeClass 对象。
107107

108108
<!--
@@ -119,17 +119,24 @@ kind: RuntimeClass
119119
metadata:
120120
# 用来引用 RuntimeClass 的名字
121121
# RuntimeClass 是一个集群层面的资源
122-
name: myclass
122+
name: myclass
123123
# 对应的 CRI 配置的名称
124124
handler: myconfiguration
125125
```
126126
127+
<!--
128+
The name of a RuntimeClass object must be a valid
129+
[DNS subdomain name](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names).
130+
-->
131+
RuntimeClass 对象的名称必须是有效的
132+
[DNS 子域名](/zh-cn/docs/concepts/overview/working-with-objects/names#dns-subdomain-names)。
133+
134+
{{< note >}}
127135
<!--
128136
It is recommended that RuntimeClass write operations (create/update/patch/delete) be
129-
restricted to the cluster administrator. This is typically the default. See
137+
restricted to the cluster administrator. This is typically the default. See
130138
[Authorization Overview](/docs/reference/access-authn-authz/authorization/) for more details.
131139
-->
132-
{{< note >}}
133140
建议将 RuntimeClass 写操作(create、update、patch 和 delete)限定于集群管理员使用。
134141
通常这是默认配置。参阅[授权概述](/zh-cn/docs/reference/access-authn-authz/authorization/)了解更多信息。
135142
{{< /note >}}
@@ -172,9 +179,9 @@ error message.
172179
If no `runtimeClassName` is specified, the default RuntimeHandler will be used, which is equivalent
173180
to the behavior when the RuntimeClass feature is disabled.
174181
-->
175-
如果未指定 `runtimeClassName` ,则将使用默认的 RuntimeHandler,相当于禁用 RuntimeClass 功能特性。
182+
如果未指定 `runtimeClassName`,则将使用默认的 RuntimeHandler,相当于禁用 RuntimeClass 功能特性。
176183

177-
<!--
184+
<!--
178185
### CRI Configuration
179186

180187
For more details on setting up CRI runtimes, see [CRI installation](/docs/setup/production-environment/container-runtimes/).
@@ -191,7 +198,7 @@ Runtime handlers are configured through containerd's configuration at
191198
`/etc/containerd/config.toml`. Valid handlers are configured under the runtimes section:
192199
-->
193200
通过 containerd 的 `/etc/containerd/config.toml` 配置文件来配置运行时 handler。
194-
handler 需要配置在 runtimes 块中:
201+
handler 需要配置在 runtimes 块中:
195202

196203
```
197204
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.${HANDLER_NAME}]
@@ -203,17 +210,16 @@ for more details:
203210
-->
204211
更详细信息,请查阅 containerd 的[配置指南](https://github.com/containerd/containerd/blob/main/docs/cri/config.md)
205212
206-
#### [cri-o](https://cri-o.io/)
213+
#### {{< glossary_tooltip term_id="cri-o" >}}
207214
208215
<!--
209-
Runtime handlers are configured through cri-o's configuration at `/etc/crio/crio.conf`. Valid
210-
handlers are configured under the [crio.runtime
211-
table](https://github.com/kubernetes-sigs/cri-o/blob/master/docs/crio.conf.5.md#crioruntime-table):
216+
Runtime handlers are configured through CRI-O's configuration at `/etc/crio/crio.conf`. Valid
217+
handlers are configured under the
218+
[crio.runtime table](https://github.com/cri-o/cri-o/blob/master/docs/crio.conf.5.md#crioruntime-table):
212219
-->
213-
通过 cri-o 的 `/etc/crio/crio.conf` 配置文件来配置运行时 handler。
220+
通过 CRI-O 的 `/etc/crio/crio.conf` 配置文件来配置运行时 handler。
214221
handler 需要配置在
215-
[crio.runtime 表](https://github.com/kubernetes-sigs/cri-o/blob/master/docs/crio.conf.5.md#crioruntime-table)
216-
下面:
222+
[crio.runtime 表](https://github.com/cri-o/cri-o/blob/master/docs/crio.conf.5.md#crioruntime-table)之下:
217223
218224
```
219225
[crio.runtime.runtimes.${HANDLER_NAME}]
@@ -225,9 +231,9 @@ See CRI-O's [config documentation](https://github.com/cri-o/cri-o/blob/master/do
225231
-->
226232
更详细信息,请查阅 CRI-O [配置文档](https://github.com/cri-o/cri-o/blob/master/docs/crio.conf.5.md)。
227233
228-
<!--
234+
<!--
229235
## Scheduling
230-
-->
236+
-->
231237
## 调度 {#scheduling}
232238
233239
{{< feature-state for_k8s_version="v1.16" state="beta" >}}
@@ -240,7 +246,7 @@ If `scheduling` is not set, this RuntimeClass is assumed to be supported by all
240246
241247
通过为 RuntimeClass 指定 `scheduling` 字段,
242248
你可以通过设置约束,确保运行该 RuntimeClass 的 Pod 被调度到支持该 RuntimeClass 的节点上。
243-
如果未设置 `scheduling`,则假定所有节点均支持此 RuntimeClass
249+
如果未设置 `scheduling`,则假定所有节点均支持此 RuntimeClass。
244250
245251
<!--
246252
To ensure pods land on nodes supporting a specific RuntimeClass, that set of nodes should have a
@@ -249,7 +255,7 @@ RuntimeClass's nodeSelector is merged with the pod's nodeSelector in admission,
249255
the intersection of the set of nodes selected by each. If there is a conflict, the pod will be
250256
rejected.
251257
-->
252-
为了确保 pod 会被调度到支持指定运行时的 node 上,每个 node 需要设置一个通用的 label 用于被
258+
为了确保 pod 会被调度到支持指定运行时的 node 上,每个 node 需要设置一个通用的 label 用于被
253259
`runtimeclass.scheduling.nodeSelector` 挑选。在 admission 阶段,RuntimeClass 的 nodeSelector 将会与
254260
pod 的 nodeSelector 合并,取二者的交集。如果有冲突,pod 将会被拒绝。
255261
@@ -263,22 +269,22 @@ by each.
263269
与 `nodeSelector` 一样,tolerations 也在 admission 阶段与 pod 的 tolerations 合并,取二者的并集。
264270
265271
<!--
266-
To learn more about configuring the node selector and tolerations, see
267-
[Assigning Pods to Nodes](/docs/concepts/configuration/assign-pod-node/).
272+
To learn more about configuring the node selector and tolerations, see
273+
[Assigning Pods to Nodes](/docs/concepts/scheduling-eviction/assign-pod-node/).
268274
-->
269-
更多有关 node selector 和 tolerations 的配置信息,请查阅
275+
更多有关 node selector 和 tolerations 的配置信息,请查阅
270276
[将 Pod 分派到节点](/zh-cn/docs/concepts/scheduling-eviction/assign-pod-node/)。
271277
272-
<!--
278+
<!--
273279
### Pod Overhead
274-
-->
280+
-->
275281
### Pod 开销 {#pod-overhead}
276282
277283
{{< feature-state for_k8s_version="v1.24" state="stable" >}}
278284
279285
<!--
280286
You can specify _overhead_ resources that are associated with running a Pod. Declaring overhead allows
281-
the cluster (including the scheduler) to account for it when making decisions about Pods and resources.
287+
the cluster (including the scheduler) to account for it when making decisions about Pods and resources.
282288
-->
283289
你可以指定与运行 Pod 相关的 _开销_ 资源。声明开销即允许集群(包括调度器)在决策 Pod 和资源时将其考虑在内。
284290

0 commit comments

Comments
 (0)