Skip to content

Commit a9d7531

Browse files
committed
concepts/extend-kubernetes/api-extension: add 1.15 features
1 parent c7c55c5 commit a9d7531

File tree

3 files changed

+455
-49
lines changed

3 files changed

+455
-49
lines changed

content/en/docs/concepts/extend-kubernetes/api-extension/custom-resources.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Aggregated APIs offer more advanced API features and customization of other feat
174174
| Feature | Description | CRDs | Aggregated API |
175175
| ------- | ----------- | ---- | -------------- |
176176
| Validation | Help users prevent errors and allow you to evolve your API independently of your clients. These features are most useful when there are many clients who can't all update at the same time. | Yes. Most validation can be specified in the CRD using [OpenAPI v3.0 validation](/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/#validation). Any other validations supported by addition of a [Validating Webhook](/docs/reference/access-authn-authz/admission-controllers/#validatingadmissionwebhook-alpha-in-1-8-beta-in-1-9). | Yes, arbitrary validation checks |
177-
| Defaulting | See above | Yes, via a [Mutating Webhook](/docs/reference/access-authn-authz/admission-controllers/#mutatingadmissionwebhook-beta-in-1-9); Planned, via CRD OpenAPI schema. | Yes |
177+
| Defaulting | See above | Yes, either via [OpenAPI v3.0 validation](/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/#defaulting) `default` keyword (alpha in 1.15), or via a [Mutating Webhook](/docs/reference/access-authn-authz/admission-controllers/#mutatingadmissionwebhook-beta-in-1-9) | Yes |
178178
| Multi-versioning | Allows serving the same object through two API versions. Can help ease API changes like renaming fields. Less important if you control your client versions. | [Yes](/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definition-versioning) | Yes |
179179
| Custom Storage | If you need storage with a different performance mode (for example, time-series database instead of key-value store) or isolation for security (for example, encryption secrets or different | No | Yes |
180180
| Custom Business Logic | Perform arbitrary checks or actions when creating, reading, updating or deleting an object | Yes, using [Webhooks](/docs/reference/access-authn-authz/extensible-admission-controllers/#admission-webhooks). | Yes |
@@ -183,7 +183,7 @@ Aggregated APIs offer more advanced API features and customization of other feat
183183
| Other Subresources | Add operations other than CRUD, such as "logs" or "exec". | No | Yes |
184184
| strategic-merge-patch | The new endpoints support PATCH with `Content-Type: application/strategic-merge-patch+json`. Useful for updating objects that may be modified both locally, and by the server. For more information, see ["Update API Objects in Place Using kubectl patch"](/docs/tasks/run-application/update-api-object-kubectl-patch/) | No | Yes |
185185
| Protocol Buffers | The new resource supports clients that want to use Protocol Buffers | No | Yes |
186-
| OpenAPI Schema | Is there an OpenAPI (swagger) schema for the types that can be dynamically fetched from the server? Is the user protected from misspelling field names by ensuring only allowed fields are set? Are types enforced (in other words, don't put an `int` in a `string` field?) | No, but planned | Yes |
186+
| OpenAPI Schema | Is there an OpenAPI (swagger) schema for the types that can be dynamically fetched from the server? Is the user protected from misspelling field names by ensuring only allowed fields are set? Are types enforced (in other words, don't put an `int` in a `string` field?) | Yes, based on the [OpenAPI v3.0 validation](/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/#validation) schema (beta in 1.15) | Yes |
187187

188188
### Common Features
189189

content/en/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definition-versioning.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ level of your CustomResourceDefinitions or advance your API to a new version wit
2929

3030
## Overview
3131

32+
{{< feature-state state="beta" for_kubernetes_version="1.15" >}}
33+
3234
The CustomResourceDefinition API supports a `versions` field that you can use to
3335
support multiple versions of custom resources that you have developed. Versions
3436
can have different schemas with a conversion webhook to convert custom resources between versions.
@@ -147,9 +149,11 @@ the version.
147149

148150
## Webhook conversion
149151

152+
{{< feature-state state="beta" for_kubernetes_version="1.15" >}}
153+
150154
{{< note >}}
151-
Webhook conversion is introduced in Kubernetes 1.13 as an alpha feature. To use it, the
152-
`CustomResourceWebhookConversion` feature should be enabled. Please refer to the [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) documentation for more information.
155+
Webhook conversion is available as beta since 1.15, and as alpha since Kubernetes 1.13. The
156+
`CustomResourceWebhookConversion` feature must be enabled, which is the case automatically for many clusters for beta features. Please refer to the [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) documentation for more information.
153157
{{< /note >}}
154158

155159
The above example has a None conversion between versions which only sets the `apiVersion` field
@@ -182,6 +186,10 @@ mutual TLS or other ways to authenticate the clients, see
182186
how to [authenticate API servers](/docs/reference/access-authn-authz/extensible-admission-controllers/#authenticate-apiservers).
183187
{{< /note >}}
184188

189+
#### Permissible mutations
190+
191+
A conversion webhook must not mutate anything inside of `metadata` of the converted object other than `labels` and `annotations`. Attempted changes to `name`, `UID` and `namespace` are rejected and fail the request which caused the conversion. All other changes are just ignored.
192+
185193
### Deploy the conversion webhook service
186194

187195
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).

0 commit comments

Comments
 (0)