Skip to content

Commit 669794b

Browse files
committed
[zh-cn] Sync docs/reference/using-api
Signed-off-by: tico88612 <[email protected]>
1 parent 4f2dd5a commit 669794b

File tree

5 files changed

+39
-21
lines changed

5 files changed

+39
-21
lines changed

content/zh-cn/docs/reference/using-api/api-concepts.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ the API server will send any `BOOKMARK` event even when requested.
381381
-->
382382
## 流式列表 {#streaming-lists}
383383

384-
{{< feature-state for_k8s_version="v1.27" state="alpha" >}}
384+
{{< feature-state feature_gate_name="WatchList" >}}
385385

386386
<!--
387387
On large clusters, retrieving the collection of some resource types may result in
@@ -474,7 +474,7 @@ Content-Type: application/json
474474
-->
475475
## 响应压缩 {#response-compression}
476476

477-
{{< feature-state for_k8s_version="v1.16" state="beta" >}}
477+
{{< feature-state feature_gate_name="APIResponseCompression" >}}
478478

479479
<!--
480480
`APIResponseCompression` is an option that allows the API server to compress the responses for **get**
@@ -524,7 +524,7 @@ The `content-encoding` header indicates that the response is compressed with `gz
524524
-->
525525
## 分块检视大体量结果 {#retrieving-large-results-sets-in-chunks}
526526

527-
{{< feature-state for_k8s_version="v1.29" state="stable" >}}
527+
{{< feature-state feature_gate_name="APIListChunking" >}}
528528

529529
<!--
530530
On large clusters, retrieving the collection of some resource types may result in
@@ -580,7 +580,7 @@ of time (by default 5 minutes) and return a `410 Gone` if more results cannot be
580580
returned. In this case, the client will need to start from the beginning or omit the
581581
`limit` parameter.
582582
583-
For example, if there are 1,253 pods on the cluster and you wants to receive chunks
583+
For example, if there are 1,253 pods on the cluster and you want to receive chunks
584584
of 500 pods at a time, request those chunks as follows:
585585
-->
586586
**watch** 操作类似,`continue` 令牌也会在很短的时间(默认为 5 分钟)内过期,
@@ -1252,7 +1252,7 @@ These situations are:
12521252
-->
12531253
### 检查无法识别或重复的字段 {#setting-the-field-validation-level}
12541254

1255-
{{< feature-state for_k8s_version="v1.27" state="stable" >}}
1255+
{{< feature-state feature_gate_name="ServerSideFieldValidation" >}}
12561256

12571257
<!--
12581258
From 1.25 onward, unrecognized or duplicate fields in an object are detected via
@@ -1355,7 +1355,7 @@ a boolean flag.
13551355
-->
13561356
## 试运行 {#dry-run}
13571357

1358-
{{< feature-state for_k8s_version="v1.18" state="stable" >}}
1358+
{{< feature-state feature_gate_name="DryRun" >}}
13591359

13601360
<!--
13611361
When you use HTTP verbs that can modify resources (`POST`, `PUT`, `PATCH`, and

content/zh-cn/docs/reference/using-api/cel.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ CEL 表达式示例:
9393
| `self.metadata.name == 'singleton'` | Validate that an object's name matches a specific value (making it a singleton) |
9494
| `self.set1.all(e, !(e in self.set2))` | Validate that two listSets are disjoint |
9595
| `self.names.size() == self.details.size() && self.names.all(n, n in self.details)` | Validate the 'details' map is keyed by the items in the 'names' listSet |
96+
| `self.details.all(key, key.matches('^[a-zA-Z]*$')` | Validate the keys of the 'details' map |
97+
| `self.details.all(key, self.details[key].matches('^[a-zA-Z]*$')` | Validate the values of the 'details' map |
9698
{{< /table >}}
9799
-->
98100
{{< table caption="CEL 表达式例子和每个表达式的用途" >}}
@@ -109,6 +111,8 @@ CEL 表达式示例:
109111
| `self.metadata.name == 'singleton'` | 验证某对象的名称与特定的值匹配(使其成为一个特例) |
110112
| `self.set1.all(e, !(e in self.set2))` | 验证两个 listSet 不相交 |
111113
| `self.names.size() == self.details.size() && self.names.all(n, n in self.details)` | 验证 'details' 映射是由 'names' listSet 中的各项键入的 |
114+
| `self.details.all(key, key.matches('^[a-zA-Z]*$')` | 验证 'details' 映射的主键 |
115+
| `self.details.all(key, self.details[key].matches('^[a-zA-Z]*$')` | 验证 'details' 映射的值 |
112116
{{< /table >}}
113117

114118
<!--

content/zh-cn/docs/reference/using-api/deprecation-guide.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,17 @@ FlowSchema 和 PriorityLevelConfiguration 的
6666
### v1.29
6767

6868
<!--
69-
The **v1.29** release will stop serving the following deprecated API versions:
69+
The **v1.29** release stopped serving the following deprecated API versions:
7070
-->
71-
**v1.29** 发行版本将停止提供以下已弃用的 API 版本:
71+
**v1.29** 发行版本停止支持以下已弃用的 API 版本:
7272

7373
<!--
7474
#### Flow control resources {#flowcontrol-resources-v129}
7575
-->
7676
#### 流控制资源 {#flowcontrol-resources-v129}
7777

7878
<!--
79-
The **flowcontrol.apiserver.k8s.io/v1beta2** API version of FlowSchema and PriorityLevelConfiguration will no longer be served in v1.29.
79+
The **flowcontrol.apiserver.k8s.io/v1beta2** API version of FlowSchema and PriorityLevelConfiguration is no longer be served in v1.29.
8080
8181
* Migrate manifests and API clients to use the **flowcontrol.apiserver.k8s.io/v1** API version, available since v1.29, or the **flowcontrol.apiserver.k8s.io/v1beta3** API version, available since v1.26.
8282
* All existing persisted objects are accessible via the new API
@@ -87,8 +87,8 @@ The **flowcontrol.apiserver.k8s.io/v1beta2** API version of FlowSchema and Prior
8787
* Notable changes in **flowcontrol.apiserver.k8s.io/v1beta3**:
8888
* The PriorityLevelConfiguration `spec.limited.assuredConcurrencyShares` field is renamed to `spec.limited.nominalConcurrencyShares`
8989
-->
90-
**flowcontrol.apiserver.k8s.io/v1beta2** API 版本的 FlowSchema
91-
和 PriorityLevelConfiguration 将不会在 v1.29 中提供
90+
从 v1.29 版本开始不再提供 **flowcontrol.apiserver.k8s.io/v1beta2** API 版本的
91+
FlowSchema 和 PriorityLevelConfiguration。
9292

9393
* 迁移清单和 API 客户端使用 **flowcontrol.apiserver.k8s.io/v1** API 版本(自 v1.29 版本开始可用),
9494
**flowcontrol.apiserver.k8s.io/v1beta3** API 版本(自 v1.26 起可用);
@@ -111,13 +111,13 @@ The **v1.27** release stopped serving the following deprecated API versions:
111111
#### CSIStorageCapacity {#csistoragecapacity-v127}
112112

113113
<!--
114-
The **storage.k8s.io/v1beta1** API version of CSIStorageCapacity will no longer be served in v1.27.
114+
The **storage.k8s.io/v1beta1** API version of CSIStorageCapacity is no longer be served in v1.27.
115115
116116
* Migrate manifests and API clients to use the **storage.k8s.io/v1** API version, available since v1.24.
117117
* All existing persisted objects are accessible via the new API
118118
* No notable changes
119119
-->
120-
**storage.k8s.io/v1beta1** API 版本的 CSIStorageCapacity 将不会在 v1.27 提供
120+
从 v1.27 版本开始不再提供 **storage.k8s.io/v1beta1** API 版本的 CSIStorageCapacity。
121121

122122
* 自 v1.24 版本起,迁移清单和 API 客户端使用 **storage.k8s.io/v1** API 版本
123123
* 所有现有的持久化对象都可以通过新的 API 访问
@@ -138,15 +138,14 @@ The **v1.26** release stopped serving the following deprecated API versions:
138138
<!--
139139
The **flowcontrol.apiserver.k8s.io/v1beta1** API version of FlowSchema and PriorityLevelConfiguration is no longer served as of v1.26.
140140
141-
* Migrate manifests and API clients to use the **flowcontrol.apiserver.k8s.io/v1beta3** API version, available since v1.26.
141+
* Migrate manifests and API clients to use the **flowcontrol.apiserver.k8s.io/v1beta2** API version.
142142
* All existing persisted objects are accessible via the new API
143143
* No notable changes
144144
-->
145145
从 v1.26 版本开始不再提供 **flowcontrol.apiserver.k8s.io/v1beta1** API 版本的
146146
FlowSchema 和 PriorityLevelConfiguration。
147147

148-
* 迁移清单和 API 客户端使用 **flowcontrol.apiserver.k8s.io/v1beta3** API 版本,
149-
此 API 从 v1.26 版本开始可用;
148+
* 迁移清单和 API 客户端使用 **flowcontrol.apiserver.k8s.io/v1beta2** API 版本;
150149
* 所有的已保存的对象都可以通过新的 API 来访问;
151150
* 没有需要额外注意的变更。
152151

@@ -157,13 +156,18 @@ The **autoscaling/v2beta2** API version of HorizontalPodAutoscaler is no longer
157156
158157
* Migrate manifests and API clients to use the **autoscaling/v2** API version, available since v1.23.
159158
* All existing persisted objects are accessible via the new API
159+
* Notable changes:
160+
* `targetAverageUtilization` is replaced with `target.averageUtilization` and `target.type: Utilization`. See [Autoscaling on multiple metrics and custom metrics](/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#autoscaling-on-multiple-metrics-and-custom-metrics).
160161
-->
161162
从 v1.26 版本开始不再提供 **autoscaling/v2beta2** API 版本的
162163
HorizontalPodAutoscaler。
163164

164165
* 迁移清单和 API 客户端使用 **autoscaling/v2** API 版本,
165166
此 API 从 v1.23 版本开始可用;
166167
* 所有的已保存的对象都可以通过新的 API 来访问。
168+
* 值得注意的变更:
169+
* `targetAverageUtilization` 被替换为 `target.averageUtilization``target.type: Utilization`
170+
请参阅[基于多项度量指标和自定义度量指标自动扩缩](/zh-cn/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#autoscaling-on-multiple-metrics-and-custom-metrics)
167171

168172
### v1.25
169173

@@ -263,12 +267,17 @@ The **autoscaling/v2beta1** API version of HorizontalPodAutoscaler is no longer
263267
264268
* Migrate manifests and API clients to use the **autoscaling/v2** API version, available since v1.23.
265269
* All existing persisted objects are accessible via the new API
270+
* Notable changes:
271+
* `targetAverageUtilization` is replaced with `target.averageUtilization` and `target.type: Utilization`. See [Autoscaling on multiple metrics and custom metrics](/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#autoscaling-on-multiple-metrics-and-custom-metrics).
266272
-->
267273
从 v1.25 版本开始不再提供 **autoscaling/v2beta1** API 版本的
268274
HorizontalPodAutoscaler。
269275

270276
* 迁移清单和 API 客户端使用 **autoscaling/v2** API 版本,此 API 从 v1.23 版本开始可用;
271277
* 所有的已保存的对象都可以通过新的 API 来访问。
278+
* 值得注意的变更:
279+
* `targetAverageUtilization` 被替换为 `target.averageUtilization``target.type: Utilization`
280+
请参阅[基于多项度量指标和自定义度量指标自动扩缩](/zh-cn/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#autoscaling-on-multiple-metrics-and-custom-metrics)
272281

273282
#### PodDisruptionBudget {#poddisruptionbudget-v125}
274283

content/zh-cn/docs/reference/using-api/health-checks.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,13 @@ healthz check passed
131131

132132
<!--
133133
Each individual health check exposes an HTTP endpoint and can be checked individually.
134-
The schema for the individual health checks is `/livez/<healthcheck-name>` where `livez` and `readyz` and be used to indicate if you want to check the liveness or the readiness of the API server.
134+
The schema for the individual health checks is `/livez/<healthcheck-name>` or `/readyz/<healthcheck-name>`, where `livez` and `readyz` can be used to indicate if you want to check the liveness or the readiness of the API server, respectively.
135135
The `<healthcheck-name>` path can be discovered using the `verbose` flag from above and take the path between `[+]` and `ok`.
136136
These individual health checks should not be consumed by machines but can be helpful for a human operator to debug a system:
137137
-->
138138
每个单独的健康检查都会公开一个 HTTP 端点,并且可以单独检查。
139-
单个运行状况检查的模式为 `/livez/<healthcheck-name>`,其中 `livez``readyz` 表明你要检查的是 API 服务器是否存活或就绪。
139+
单个运行状况检查的模式为 `/livez/<healthcheck-name>``/readyz/<healthcheck-name>`
140+
其中 `livez``readyz` 分别表明你要检查的是 API 服务器是否存活或就绪。
140141
`<healthcheck-name>` 的路径可以通过上面的 `verbose` 参数发现 ,并采用 `[+]``ok` 之间的路径。
141142
这些单独的健康检查不应由机器使用,但对于操作人员调试系统而言,是有帮助的:
142143

content/zh-cn/docs/reference/using-api/server-side-apply.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ weight: 25
1616

1717
<!-- overview -->
1818

19-
{{< feature-state for_k8s_version="v1.22" state="stable" >}}
19+
{{< feature-state feature_gate_name="ServerSideApply" >}}
2020

2121
<!--
2222
Kubernetes supports multiple appliers collaborating to manage the fields
@@ -326,12 +326,16 @@ as [YAML](https://yaml.org/), with the media type `application/apply-patch+yaml`
326326
Whether you are submitting JSON data or YAML data, use
327327
`application/apply-patch+yaml` as the `Content-Type` header value.
328328

329-
All JSON documents are valid YAML.
329+
All JSON documents are valid YAML. However, Kubernetes has a bug where it uses a YAML
330+
parser that does not fully implement the YAML specification. Some JSON escapes may
331+
not be recognized.
330332
-->
331333
不管你提交的是 JSON 数据还是 YAML 数据,
332334
都要使用 `application/apply-patch+yaml` 作为 `Content-Type` 的值。
333335

334-
所有的 JSON 文档 都是合法的 YAML。
336+
所有的 JSON 文档都是合法的 YAML。不过,Kubernetes 存在一个缺陷,
337+
即它使用的 YAML 解析器没有完全实现 YAML 规范。
338+
某些 JSON 转义可能无法被识别。
335339
{{< /note >}}
336340

337341
<!--

0 commit comments

Comments
 (0)