Skip to content

Commit

Permalink
[zh-cn] Sync docs/reference/using-api
Browse files Browse the repository at this point in the history
Signed-off-by: tico88612 <17496418+tico88612@users.noreply.github.com>
  • Loading branch information
tico88612 committed Apr 30, 2024
1 parent 4f2dd5a commit 669794b
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 21 deletions.
12 changes: 6 additions & 6 deletions content/zh-cn/docs/reference/using-api/api-concepts.md
Expand Up @@ -381,7 +381,7 @@ the API server will send any `BOOKMARK` event even when requested.
-->
## 流式列表 {#streaming-lists}

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

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

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

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

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

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

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

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

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

<!--
When you use HTTP verbs that can modify resources (`POST`, `PUT`, `PATCH`, and
Expand Down
4 changes: 4 additions & 0 deletions content/zh-cn/docs/reference/using-api/cel.md
Expand Up @@ -93,6 +93,8 @@ CEL 表达式示例:
| `self.metadata.name == 'singleton'` | Validate that an object's name matches a specific value (making it a singleton) |
| `self.set1.all(e, !(e in self.set2))` | Validate that two listSets are disjoint |
| `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 |
| `self.details.all(key, key.matches('^[a-zA-Z]*$')` | Validate the keys of the 'details' map |
| `self.details.all(key, self.details[key].matches('^[a-zA-Z]*$')` | Validate the values of the 'details' map |
{{< /table >}}
-->
{{< table caption="CEL 表达式例子和每个表达式的用途" >}}
Expand All @@ -109,6 +111,8 @@ CEL 表达式示例:
| `self.metadata.name == 'singleton'` | 验证某对象的名称与特定的值匹配(使其成为一个特例) |
| `self.set1.all(e, !(e in self.set2))` | 验证两个 listSet 不相交 |
| `self.names.size() == self.details.size() && self.names.all(n, n in self.details)` | 验证 'details' 映射是由 'names' listSet 中的各项键入的 |
| `self.details.all(key, key.matches('^[a-zA-Z]*$')` | 验证 'details' 映射的主键 |
| `self.details.all(key, self.details[key].matches('^[a-zA-Z]*$')` | 验证 'details' 映射的值 |
{{< /table >}}

<!--
Expand Down
29 changes: 19 additions & 10 deletions content/zh-cn/docs/reference/using-api/deprecation-guide.md
Expand Up @@ -66,17 +66,17 @@ FlowSchema 和 PriorityLevelConfiguration 的
### v1.29

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

<!--
#### Flow control resources {#flowcontrol-resources-v129}
-->
#### 流控制资源 {#flowcontrol-resources-v129}

<!--
The **flowcontrol.apiserver.k8s.io/v1beta2** API version of FlowSchema and PriorityLevelConfiguration will no longer be served in v1.29.
The **flowcontrol.apiserver.k8s.io/v1beta2** API version of FlowSchema and PriorityLevelConfiguration is no longer be served in v1.29.
* 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.
* All existing persisted objects are accessible via the new API
Expand All @@ -87,8 +87,8 @@ The **flowcontrol.apiserver.k8s.io/v1beta2** API version of FlowSchema and Prior
* Notable changes in **flowcontrol.apiserver.k8s.io/v1beta3**:
* The PriorityLevelConfiguration `spec.limited.assuredConcurrencyShares` field is renamed to `spec.limited.nominalConcurrencyShares`
-->
**flowcontrol.apiserver.k8s.io/v1beta2** API 版本的 FlowSchema
和 PriorityLevelConfiguration 将不会在 v1.29 中提供
从 v1.29 版本开始不再提供 **flowcontrol.apiserver.k8s.io/v1beta2** API 版本的
FlowSchema 和 PriorityLevelConfiguration。

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

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

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

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

Expand All @@ -157,13 +156,18 @@ The **autoscaling/v2beta2** API version of HorizontalPodAutoscaler is no longer
* Migrate manifests and API clients to use the **autoscaling/v2** API version, available since v1.23.
* All existing persisted objects are accessible via the new API
* Notable changes:
* `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).
-->
从 v1.26 版本开始不再提供 **autoscaling/v2beta2** API 版本的
HorizontalPodAutoscaler。

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

### v1.25

Expand Down Expand Up @@ -263,12 +267,17 @@ The **autoscaling/v2beta1** API version of HorizontalPodAutoscaler is no longer
* Migrate manifests and API clients to use the **autoscaling/v2** API version, available since v1.23.
* All existing persisted objects are accessible via the new API
* Notable changes:
* `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).
-->
从 v1.25 版本开始不再提供 **autoscaling/v2beta1** API 版本的
HorizontalPodAutoscaler。

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

#### PodDisruptionBudget {#poddisruptionbudget-v125}

Expand Down
5 changes: 3 additions & 2 deletions content/zh-cn/docs/reference/using-api/health-checks.md
Expand Up @@ -131,12 +131,13 @@ healthz check passed

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

Expand Down
10 changes: 7 additions & 3 deletions content/zh-cn/docs/reference/using-api/server-side-apply.md
Expand Up @@ -16,7 +16,7 @@ weight: 25

<!-- overview -->

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

<!--
Kubernetes supports multiple appliers collaborating to manage the fields
Expand Down Expand Up @@ -326,12 +326,16 @@ as [YAML](https://yaml.org/), with the media type `application/apply-patch+yaml`
Whether you are submitting JSON data or YAML data, use
`application/apply-patch+yaml` as the `Content-Type` header value.
All JSON documents are valid YAML.
All JSON documents are valid YAML. However, Kubernetes has a bug where it uses a YAML
parser that does not fully implement the YAML specification. Some JSON escapes may
not be recognized.
-->
不管你提交的是 JSON 数据还是 YAML 数据,
都要使用 `application/apply-patch+yaml` 作为 `Content-Type` 的值。

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

<!--
Expand Down

0 comments on commit 669794b

Please sign in to comment.