Skip to content

Commit ea97743

Browse files
authored
Merge pull request #39079 from Zhuzhenghao/custom-resource-definition-versioning
[zh-cn] Cleanup custom-resource-definition-versioning page
2 parents a21a0c2 + f99e033 commit ea97743

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

content/zh-cn/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ Adding a new version:
7373
7474
1. Pick a conversion strategy. Since custom resource objects need the ability to
7575
be served at both versions, that means they will sometimes be served in a
76-
different version than the one stored. To make this possible, the custom
77-
resource objects must sometimes be converted between the
76+
different version than the one stored. To make this possible, the custom resource objects must sometimes be converted between the
7877
version they are stored at and the version they are served at. If the
7978
conversion involves schema changes and requires custom logic, a conversion
8079
webhook should be used. If there are no schema changes, the default `None`
@@ -132,7 +131,7 @@ Removing an old version:
132131
1. Set `served` to `false` for the old version in the `spec.versions` list. If
133132
any clients are still unexpectedly using the old version they may begin reporting
134133
errors attempting to access the custom resource objects at the old version.
135-
If this occurs, switch back to using `served:true` on the old version, migrate the
134+
If this occurs, switch back to using `served:true` on the old version, migrate the
136135
remaining clients to the new version and repeat this step.
137136
1. Ensure the [upgrade of existing objects to the new stored version](#upgrade-existing-objects-to-a-new-stored-version) step has been completed.
138137
1. Verify that the `storage` is set to `true` for the new version in the `spec.versions` list in the CustomResourceDefinition.
@@ -532,9 +531,6 @@ spec:
532531

533532
<!--
534533
## Webhook conversion
535-
536-
Webhook conversion is available as beta since 1.15, and as alpha since Kubernetes 1.13. The
537-
`CustomResourceWebhookConversion` feature should be enabled. Please refer to the [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) documentation for more information.
538534
-->
539535
## Webhook 转换 {#webhook-conversion}
540536

@@ -627,7 +623,7 @@ how to [authenticate API servers](/docs/reference/access-authn-authz/extensible-
627623
A conversion webhook must not mutate anything inside of `metadata` of the converted object
628624
other than `labels` and `annotations`.
629625
Attempted changes to `name`, `UID` and `namespace` are rejected and fail the request
630-
which caused the conversion. All other changes are ignored.
626+
which caused the conversion. All other changes are ignored.
631627
-->
632628
#### 被允许的变更
633629

@@ -639,8 +635,10 @@ which caused the conversion. All other changes are ignored.
639635
<!--
640636
### Deploy the conversion webhook service
641637

642-
Documentation for deploying the conversion webhook is the same as for the [admission webhook example service](/docs/reference/access-authn-authz/extensible-admission-controllers/#deploy_the_admission_webhook_service).
643-
The assumption for next sections is that the conversion webhook server is deployed to a service named `example-conversion-webhook-server` in `default` namespace and serving traffic on path `/crdconvert`.
638+
Documentation for deploying the conversion webhook is the same as for the
639+
[admission webhook example service](/docs/reference/access-authn-authz/extensible-admission-controllers/#deploy_the_admission_webhook_service).
640+
The assumption for next sections is that the conversion webhook server is deployed to a service
641+
named `example-conversion-webhook-server` in `default` namespace and serving traffic on path `/crdconvert`.
644642
-->
645643
### 部署转换 Webhook 服务 {#deploy-the-conversion-webhook-service}
646644

@@ -842,7 +840,7 @@ API 服务器一旦确定请求应发送到转换 Webhook,它需要知道如
842840

843841
<!--
844842
`url` gives the location of the webhook, in standard URL form
845-
(`scheme://host:port/path`).
843+
(`scheme://host:port/path`).
846844

847845
The `host` should not refer to a service running in the cluster; use
848846
a service reference by specifying the `service` field instead.
@@ -1019,7 +1017,7 @@ spec:
10191017
```
10201018

10211019
<!--
1022-
`conversionReviewVersions` is a required field when creating
1020+
`conversionReviewVersions` is a required field when creating
10231021
`apiextensions.k8s.io/v1` custom resource definitions.
10241022
Webhooks are required to support at least one `ConversionReview`
10251023
version understood by the current and previous API server.
@@ -1043,7 +1041,7 @@ spec:
10431041
...
10441042
```
10451043
<!--
1046-
If no `conversionReviewVersions` are specified, the default when creating
1044+
If no `conversionReviewVersions` are specified, the default when creating
10471045
`apiextensions.k8s.io/v1beta1` custom resource definitions is `v1beta1`.
10481046
-->
10491047
创建 apiextensions.k8s.io/v1beta1 定制资源定义时若未指定
@@ -1298,7 +1296,7 @@ If conversion fails, a webhook should return a `response` stanza containing the
12981296
{{< warning >}}
12991297
<!--
13001298
Failing conversion can disrupt read and write access to the custom resources,
1301-
including the ability to update or delete the resources. Conversion failures
1299+
including the ability to update or delete the resources. Conversion failures
13021300
should be avoided whenever possible, and should not be used to enforce validation
13031301
constraints (use validation schemas or webhook admission instead).
13041302
-->
@@ -1383,7 +1381,7 @@ request depends on what is specified in the CRD's `spec.conversion`:
13831381
<!--
13841382
- if the default `strategy` value `None` is specified, the only modifications
13851383
to the object are changing the `apiVersion` string and perhaps [pruning
1386-
unknown fields](/docs/concepts/extend-kubernetes/api-extension/custom-resources/custom-resource-definitions/#field-pruning)
1384+
unknown fields](/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#field-pruning)
13871385
(depending on the configuration). Note that this is unlikely to lead to good
13881386
results if the schemas differ between the storage and requested version.
13891387
In particular, you should not use this strategy if the same data is
@@ -1493,7 +1491,7 @@ The following is an example procedure to upgrade from `v1beta1` to `v1`.
14931491
`storedVersions`现在是 `v1beta1, v1`。
14941492
2. 编写升级过程以列出所有现有对象并使用相同内容将其写回存储。
14951493
这会强制后端使用当前存储版本(即 `v1`)写入对象。
1496-
3. 从 CustomResourceDefinition 的 `status.storedVersions` 字段中删除 `v1beta1`。
1494+
3. 从 CustomResourceDefinition 的 `status.storedVersions` 字段中删除 `v1beta1`。
14971495

14981496
{{< note >}}
14991497
<!--

0 commit comments

Comments
 (0)