Skip to content

Commit 85f0761

Browse files
committed
Add doc for CRD version removal
1 parent 1fb4ad3 commit 85f0761

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

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

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

355355

356+
### Version removal
357+
358+
An API version can be removed if there is a newer API version served and stored in the API server for at least 3 Kubernetes releases.
359+
The older API version cannot be dropped from the CRD manifest until data has been migrated to the newer API version for all clusters that served the older version of the CRD and cleared the older version from status.storedVersions.
360+
361+
{{< tabs name="CustomResourceDefinition_versioning_removal" >}}
362+
{{% tab name="apiextensions.k8s.io/v1" %}}
363+
```yaml
364+
apiVersion: apiextensions.k8s.io/v1
365+
kind: CustomResourceDefinition
366+
name: crontabs.example.com
367+
spec:
368+
group: example.com
369+
names:
370+
plural: crontabs
371+
singular: crontab
372+
kind: CronTab
373+
scope: Namespaced
374+
versions:
375+
- name: v1beta1
376+
served: false
377+
# This indicates the v1beta1 version of the custom resource is no longer served.
378+
# API requests to this version receive a not found error in the server response.
379+
schema: ...
380+
- name: v1
381+
served: true
382+
storage: true
383+
schema: ...
384+
```
385+
356386
## Webhook conversion
357387

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

0 commit comments

Comments
 (0)