@@ -16,30 +16,21 @@ This page describes the RuntimeClass resource and runtime selection mechanism.
16
16
-->
17
17
本页面描述了 RuntimeClass 资源和运行时的选择机制。
18
18
19
- {{< warning >}}
20
19
<!--
21
- RuntimeClass includes *breaking* changes in the beta upgrade in v1.14. If you were using
22
- RuntimeClass prior to v1.14, see [Upgrading RuntimeClass from Alpha to
23
- Beta](#upgrading-runtimeclass-from-alpha-to-beta).
24
- --> RuntimeClass 特性在 v1.14 版本升级为 beta 特性时引入了不兼容的改变。
25
- 如果你在 v1.14 以前的版本中使用 RuntimeClass,请查阅
26
- [ Upgrading RuntimeClass from Alpha to Beta] ( #upgrading-runtimeclass-from-alpha-to-beta ) 。
27
- {{< /warning >}}
20
+ RuntimeClass is a feature for selecting the container runtime configuration. The container runtime
21
+ configuration is used to run a Pod's containers.
22
+ -->
23
+ RuntimeClass 是一个用于选择容器运行时配置的特性,容器运行时配置用于运行 Pod 中的容器。
28
24
29
25
{{% /capture %}}
30
26
31
27
32
28
{{% capture body %}}
33
29
34
- ## Runtime Class
35
-
36
- <!--
37
- RuntimeClass is a feature for selecting the container runtime configuration. The container runtime
38
- configuration is used to run a Pod's containers.
39
- -->
40
- RuntimeClass 是用于选择容器运行时配置的特性,容器运行时配置用于运行 Pod 中的容器。
41
-
30
+ <!--
42
31
## Motivation
32
+ -->
33
+ ## 动机
43
34
44
35
<!--
45
36
You can set a different RuntimeClass between different Pods to provide a balance of
@@ -61,9 +52,9 @@ but with different settings.
61
52
您还可以使用 RuntimeClass 运行具有相同容器运行时但具有不同设置的pod。
62
53
63
54
<!--
64
- ### Set Up
55
+ ## Setup
65
56
-->
66
- ### 设置
57
+ ## 设置
67
58
68
59
<!--
69
60
Ensure the RuntimeClass feature gate is enabled (it is by default). See [Feature
@@ -73,7 +64,7 @@ feature gates. The `RuntimeClass` feature gate must be enabled on apiservers _an
73
64
确保 RuntimeClass 特性开关处于开启状态(默认为开启状态)。
74
65
关于特性开关的详细介绍,请查阅
75
66
[ Feature Gates] ( /docs/reference/command-line-tools-reference/feature-gates/ ) 。
76
- ` RuntimeClass ` 特性开关必须在 apiservers 和 kubelets 同时开启。
67
+ ` RuntimeClass ` 特性开关必须在 apiserver 和 kubelet 同时开启。
77
68
78
69
<!--
79
70
1. Configure the CRI implementation on nodes (runtime dependent)
@@ -84,9 +75,9 @@ feature gates. The `RuntimeClass` feature gate must be enabled on apiservers _an
84
75
2 . 创建相应的 RuntimeClass 资源
85
76
86
77
<!--
87
- #### 1. Configure the CRI implementation on nodes
78
+ ### 1. Configure the CRI implementation on nodes
88
79
-->
89
- #### 1. 在节点上配置 CRI 实现
80
+ ### 1. 在节点上配置 CRI 实现
90
81
91
82
<!--
92
83
The configurations available through RuntimeClass are Container Runtime Interface (CRI)
@@ -100,9 +91,9 @@ RuntimeClass 的配置依赖于 运行时接口(CRI)的实现。
100
91
<!--
101
92
RuntimeClass assumes a homogeneous node configuration across the cluster by default (which means
102
93
that all nodes are configured the same way with respect to container runtimes). To support
103
- heterogenous node configurations, see [Scheduling](#scheduling) below.--> RuntimeClass 假设集群中的节点配置是同构的
104
- (换言之,所有的节点在容器运行时方面的配置是相同的)。
105
- 如果需要支持异构节点,配置方法请参阅下面的 [ Scheduling ] ( #scheduling ) 。
94
+ heterogenous node configurations, see [Scheduling](#scheduling) below.-->
95
+ RuntimeClass 假设集群中的节点配置是同构的 (换言之,所有的节点在容器运行时方面的配置是相同的)。
96
+ 如果需要支持异构节点,配置方法请参阅下面的 [ 调度 ] ( #scheduling ) 。
106
97
{{< /note >}}
107
98
108
99
<!--
@@ -113,9 +104,9 @@ handler must be a valid DNS 1123 label (alpha-numeric + `-` characters).
113
104
handler 必须符合 DNS-1123 命名规范(字母、数字、或 ` - ` )。
114
105
115
106
<!--
116
- #### 2. Create the corresponding RuntimeClass resources
107
+ ### 2. Create the corresponding RuntimeClass resources
117
108
-->
118
- #### 2. 创建相应的 RuntimeClass 资源
109
+ ### 2. 创建相应的 RuntimeClass 资源
119
110
120
111
<!--
121
112
The configurations setup in step 1 should each have an associated `handler` name, which identifies
@@ -149,9 +140,9 @@ Overview](/docs/reference/access-authn-authz/authorization/) for more details.--
149
140
{{< /note >}}
150
141
151
142
<!--
152
- ### Usage
143
+ ## Usage
153
144
-->
154
- ### 使用说明
145
+ ## 使用说明
155
146
156
147
<!--
157
148
Once RuntimeClasses are configured for the cluster, using them is very simple. Specify a
@@ -187,12 +178,15 @@ to the behavior when the RuntimeClass feature is disabled.
187
178
-->
188
179
如果未指定 `runtimeClassName` ,则将使用默认的 RuntimeHandler,相当于禁用 RuntimeClass 功能特性。
189
180
181
+ <!--
190
182
# ## CRI Configuration
183
+ -->
184
+ # ## CRI 配置
191
185
192
186
<!--
193
187
For more details on setting up CRI runtimes, see [CRI installation](/docs/setup/production-environment/container-runtimes/).
194
188
-->
195
- 关于如何安装 CRI 运行时,请查阅[CRI installation ](/docs/setup/production-environment/container-runtimes/)。
189
+ 关于如何安装 CRI 运行时,请查阅 [CRI 安装 ](/docs/setup/production-environment/container-runtimes/)。
196
190
197
191
# ### dockershim
198
192
@@ -229,7 +223,7 @@ handlers are configured under the [crio.runtime
229
223
table](https://github.com/kubernetes-sigs/cri-o/blob/master/docs/crio.conf.5.md#crioruntime-table):
230
224
-->
231
225
通过 cri-o 的 `/etc/crio/crio.conf` 配置文件来配置运行时 handler。
232
- handler 需要配置在[crio.runtime 表](https://github.com/kubernetes-sigs/cri-o/blob/master/docs/crio.conf.5.md#crioruntime-table)
226
+ handler 需要配置在 [crio.runtime 表](https://github.com/kubernetes-sigs/cri-o/blob/master/docs/crio.conf.5.md#crioruntime-table)
233
227
下方:
234
228
235
229
```
@@ -244,19 +238,22 @@ https://github.com/kubernetes-sigs/cri-o/blob/master/cmd/crio/config.go
244
238
更详细信息,请查阅 containerd 配置文档:
245
239
https://github.com/kubernetes-sigs/cri-o/blob/master/cmd/crio/config.go
246
240
247
- ### Scheduling
241
+ <!--
242
+ ## Scheduling
243
+ -->
244
+ ## 调度
248
245
249
246
{{< feature-state for_k8s_version="v1.16" state="beta" >}}
250
247
251
248
<!--
252
249
As of Kubernetes v1.16, RuntimeClass includes support for heterogenous clusters through its
253
250
`scheduling` fields. Through the use of these fields, you can ensure that pods running with this
254
251
RuntimeClass are scheduled to nodes that support it. To use the scheduling support, you must have
255
- the RuntimeClass [ admission controller][] enabled (the default, as of 1.16).
252
+ the [ RuntimeClass admission controller][] enabled (the default, as of 1.16).
256
253
-->
257
254
在 Kubernetes v1.16 版本里,RuntimeClass 特性引入了 `scheduling` 字段来支持异构集群。
258
255
通过该字段,可以确保 pod 被调度到支持指定运行时的节点上。
259
- 该调度支持,需要确保 RuntimeClass [ admission controller][] 处于开启状态(1.16 版本默认开启)。
256
+ 该调度支持,需要确保 [ RuntimeClass admission controller][] 处于开启状态(1.16 版本默认开启)。
260
257
261
258
<!--
262
259
To ensure pods land on nodes supporting a specific RuntimeClass, that set of nodes should have a
@@ -285,83 +282,43 @@ Nodes](/docs/concepts/configuration/assign-pod-node/).
285
282
更多有关 node selector 和 tolerations 的配置信息,请查阅
286
283
[Assigning Pods to Nodes](/docs/concepts/configuration/assign-pod-node/)。
287
284
288
- [admission controller]: /docs/reference/access-authn-authz/admission-controllers/
285
+ [RuntimeClass admission controller]: /docs/reference/access-authn-authz/admission-controllers/
289
286
287
+ <!--
290
288
### Pod Overhead
289
+ -->
290
+ ### Pod 开销
291
291
292
- {{< feature-state for_k8s_version="v1.16 " state="alpha " >}}
292
+ {{< feature-state for_k8s_version="v1.18 " state="beta " >}}
293
293
294
294
<!--
295
- As of Kubernetes v1.16, RuntimeClass includes support for specifying overhead associated with
296
- running a pod, as part of the [`PodOverhead`](/docs/concepts/configuration/pod-overhead) feature.
297
- To use `PodOverhead` , you must have the PodOverhead [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
298
- enabled (it is off by default).
295
+ You can specify _overhead_ resources that are associated with running a Pod. Declaring overhead allows
296
+ the cluster (including the scheduler) to account for it when making decisions about Pods and resources.
297
+ To use Pod overhead , you must have the PodOverhead [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
298
+ enabled (it is on by default).
299
299
-->
300
- 在 Kubernetes v1.16 版本中,RuntimeClass 开始支持 pod 的 overhead,作为 [`PodOverhead`](/docs/concepts/configuration/pod-overhead)
301
- 特性的一部分。
302
- 若要使用 `PodOverhead` 特性,你需要确保 PodOverhead 特性开关处于开启状态(默认为关闭状态)。
300
+ 你可以指定与运行 Pod 相关的 _开销_ 资源。声明开销即允许集群(包括调度器)在决策 Pod 和资源时将其考虑在内。
301
+ 若要使用 Pod 开销特性,你必须确保 PodOverhead [特性开关](/docs/reference/command-line-tools-reference/feature-gates/) 处于开启状态(默认为启用状态)。
303
302
304
303
<!--
305
304
Pod overhead is defined in RuntimeClass through the `Overhead` fields. Through the use of these fields,
306
305
you can specify the overhead of running pods utilizing this RuntimeClass and ensure these overheads
307
306
are accounted for in Kubernetes.
308
307
-->
309
- Pod 的 overhead 在 RuntimeClass 的 `Overhead ` 字段定义,该字段用于指定使用 RuntimeClass 特性时带来的 overhead 。
308
+ Pod 开销通过 RuntimeClass 的 `overhead ` 字段定义。通过使用这些字段,你可以指定使用该 RuntimeClass 运行 Pod 时的开销并确保 Kubernetes 将这些开销计算在内 。
310
309
311
- ### Upgrading RuntimeClass from Alpha to Beta
312
-
313
- <!--
314
- The RuntimeClass Beta feature includes the following changes:
315
- -->
316
- RuntimeClass Beta 特性包含如下几个改变:
317
-
318
- <!--
319
- - The `node.k8s.io` API group and `runtimeclasses.node.k8s.io` resource have been migrated to a
320
- built-in API from a CustomResourceDefinition.
321
- - The `spec` has been inlined in the RuntimeClass definition (i.e. there is no more
322
- RuntimeClassSpec).
323
- - The `runtimeHandler` field has been renamed `handler`.
324
- - The `handler` field is now required in all API versions. This means the `runtimeHandler` field in
325
- the Alpha API is also required.
326
- - The `handler` field must be a valid DNS label ([RFC 1123](https://tools.ietf.org/html/rfc1123)),
327
- meaning it can no longer contain `.` characters (in all versions). Valid handlers match the
328
- following regular expression: `^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`.
329
- -->
330
- - `node.k8s.io` API 组和 `runtimeclasses.node.k8s.io` 资源已从 CRD 中迁移到内置的 API 中;
331
- - `spec` 被放置到 RuntimeClass 中(例如,没有 RuntimeClassSpec 了);
332
- - `runtimeHandler` 字段重命名为 `handler`;
333
- - `handler` 字段需要在所有版本的 API 提供,这意味着 `runtimeHandler` 字段在 Alpha API 中也需要提供;
334
- - `handler` 字段必须是一个合法的 DNS 标识([RFC 1123](https://tools.ietf.org/html/rfc1123)),
335
- 这意味着不可以包含 `.` 字符。合法的 handler 必须满足如下规则:`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`。
336
-
337
- <!--
338
- **Action Required:** The following actions are required to upgrade from the alpha version of the
339
- RuntimeClass feature to the beta version:
340
- -->
341
- **Action Required:** RuntimeClass 特性从 alpha 版本升级到 beta 版本,需要做如下动作:
310
+ {{% /capture %}}
311
+ {{% capture whatsnext %}}
342
312
343
313
<!--
344
- - RuntimeClass resources must be recreated *after* upgrading to v1.14, and the
345
- `runtimeclasses.node.k8s.io` CRD should be manually deleted:
346
- ```
347
- kubectl delete customresourcedefinitions.apiextensions.k8s.io runtimeclasses.node.k8s.io
348
- ```
349
- - Alpha RuntimeClasses with an unspecified or empty `runtimeHandler` or those using a `.` character
350
- in the handler are no longer valid, and must be migrated to a valid handler configuration (see
351
- above).
352
- -->
353
- - RuntimeClass 资源必须在升级到 v1.14 *之后* 再创建,并且 CRD 资源 `runtimeclasses.node.k8s.io` 必须要手动删除:
354
- ```
355
- kubectl delete customresourcedefinitions.apiextensions.k8s.io runtimeclasses.node.k8s.io
356
- ```
357
- - RuntimeClasses 中未指定或为空的 `runtimeHandler` 和 使用包含 `.` 符号的 handler 将不再合法,
358
- 必须迁移成合法的 handler 配置(见上)。
359
-
360
- ### Further Reading
361
-
362
314
- [RuntimeClass Design](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/runtime-class.md)
363
315
- [RuntimeClass Scheduling Design](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/runtime-class-scheduling.md)
364
316
- Read about the [Pod Overhead](/docs/concepts/configuration/pod-overhead/) concept
365
317
- [PodOverhead Feature Design](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/20190226-pod-overhead.md)
318
+ -->
319
+ - [RuntimeClass 设计](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/runtime-class.md)
320
+ - [RuntimeClass 调度设计](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/runtime-class-scheduling.md)
321
+ - 阅读关于 [Pod 开销](/docs/concepts/configuration/pod-overhead/) 的概念
322
+ - [PodOverhead 特性设计](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/20190226-pod-overhead.md)
366
323
367
324
{{% /capture %}}
0 commit comments