From 669794b911f119c823dd57886488acaaf552efd1 Mon Sep 17 00:00:00 2001 From: tico88612 <17496418+tico88612@users.noreply.github.com> Date: Tue, 30 Apr 2024 00:30:14 +0800 Subject: [PATCH] [zh-cn] Sync docs/reference/using-api Signed-off-by: tico88612 <17496418+tico88612@users.noreply.github.com> --- .../docs/reference/using-api/api-concepts.md | 12 ++++---- content/zh-cn/docs/reference/using-api/cel.md | 4 +++ .../reference/using-api/deprecation-guide.md | 29 ++++++++++++------- .../docs/reference/using-api/health-checks.md | 5 ++-- .../reference/using-api/server-side-apply.md | 10 +++++-- 5 files changed, 39 insertions(+), 21 deletions(-) diff --git a/content/zh-cn/docs/reference/using-api/api-concepts.md b/content/zh-cn/docs/reference/using-api/api-concepts.md index e1d1e02dfb781..196e35094b7c4 100644 --- a/content/zh-cn/docs/reference/using-api/api-concepts.md +++ b/content/zh-cn/docs/reference/using-api/api-concepts.md @@ -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" >}} ## 响应压缩 {#response-compression} -{{< feature-state for_k8s_version="v1.16" state="beta" >}} +{{< feature-state feature_gate_name="APIResponseCompression" >}} ## 分块检视大体量结果 {#retrieving-large-results-sets-in-chunks} -{{< feature-state for_k8s_version="v1.29" state="stable" >}} +{{< feature-state feature_gate_name="APIListChunking" >}} 与 **watch** 操作类似,`continue` 令牌也会在很短的时间(默认为 5 分钟)内过期, @@ -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" >}} ## 试运行 {#dry-run} -{{< feature-state for_k8s_version="v1.18" state="stable" >}} +{{< feature-state feature_gate_name="DryRun" >}} {{< table caption="CEL 表达式例子和每个表达式的用途" >}} @@ -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 >}} -**v1.29** 发行版本将停止提供以下已弃用的 API 版本: +**v1.29** 发行版本停止支持以下已弃用的 API 版本: -**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 起可用); @@ -111,13 +111,13 @@ The **v1.27** release stopped serving the following deprecated API versions: #### CSIStorageCapacity {#csistoragecapacity-v127} -**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 访问 @@ -138,15 +138,14 @@ The **v1.26** release stopped serving the following deprecated API versions: 从 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 来访问; * 没有需要额外注意的变更。 @@ -157,6 +156,8 @@ 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。 @@ -164,6 +165,9 @@ 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 @@ -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} diff --git a/content/zh-cn/docs/reference/using-api/health-checks.md b/content/zh-cn/docs/reference/using-api/health-checks.md index a62840b2efb72..241b04de2d369 100644 --- a/content/zh-cn/docs/reference/using-api/health-checks.md +++ b/content/zh-cn/docs/reference/using-api/health-checks.md @@ -131,12 +131,13 @@ healthz check passed 每个单独的健康检查都会公开一个 HTTP 端点,并且可以单独检查。 -单个运行状况检查的模式为 `/livez/`,其中 `livez` 和 `readyz` 表明你要检查的是 API 服务器是否存活或就绪。 +单个运行状况检查的模式为 `/livez/` 或 `/readyz/`, +其中 `livez` 和 `readyz` 分别表明你要检查的是 API 服务器是否存活或就绪。 `` 的路径可以通过上面的 `verbose` 参数发现 ,并采用 `[+]` 和 `ok` 之间的路径。 这些单独的健康检查不应由机器使用,但对于操作人员调试系统而言,是有帮助的: diff --git a/content/zh-cn/docs/reference/using-api/server-side-apply.md b/content/zh-cn/docs/reference/using-api/server-side-apply.md index 8eedbe818b1cf..8ae947541d004 100644 --- a/content/zh-cn/docs/reference/using-api/server-side-apply.md +++ b/content/zh-cn/docs/reference/using-api/server-side-apply.md @@ -16,7 +16,7 @@ weight: 25 -{{< feature-state for_k8s_version="v1.22" state="stable" >}} +{{< feature-state feature_gate_name="ServerSideApply" >}} 不管你提交的是 JSON 数据还是 YAML 数据, 都要使用 `application/apply-patch+yaml` 作为 `Content-Type` 的值。 -所有的 JSON 文档 都是合法的 YAML。 +所有的 JSON 文档都是合法的 YAML。不过,Kubernetes 存在一个缺陷, +即它使用的 YAML 解析器没有完全实现 YAML 规范。 +某些 JSON 转义可能无法被识别。 {{< /note >}}