Skip to content

Commit 484995c

Browse files
authored
Merge pull request #33930 from xing-yang/deprecate_crd
Add doc for CRD version removal
2 parents 78249f3 + 7cdbb1f commit 484995c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,34 @@ spec:
353353
{{< /tabs >}}
354354

355355

356+
### Version removal
357+
358+
An older API version cannot be dropped from a CustomResourceDefinition manifest until existing persisted data has been migrated to the newer API version for all clusters that served the older version of the custom resource, and the old version is removed from the `status.storedVersions` of the CustomResourceDefinition.
359+
360+
```yaml
361+
apiVersion: apiextensions.k8s.io/v1
362+
kind: CustomResourceDefinition
363+
name: crontabs.example.com
364+
spec:
365+
group: example.com
366+
names:
367+
plural: crontabs
368+
singular: crontab
369+
kind: CronTab
370+
scope: Namespaced
371+
versions:
372+
- name: v1beta1
373+
# This indicates the v1beta1 version of the custom resource is no longer served.
374+
# API requests to this version receive a not found error in the server response.
375+
served: false
376+
schema: ...
377+
- name: v1
378+
served: true
379+
# The new served version should be set as the storage version
380+
storage: true
381+
schema: ...
382+
```
383+
356384
## Webhook conversion
357385

358386
{{< feature-state state="stable" for_k8s_version="v1.16" >}}

0 commit comments

Comments
 (0)