From f71e04137220fe6d774eb1770067258d8234adb6 Mon Sep 17 00:00:00 2001 From: Anthony Yeh Date: Fri, 27 Oct 2017 10:15:22 -0700 Subject: [PATCH] CRD: Document cleanup on delete. (#6075) Make it clear that deleting a CRD deletes everything in it. --- .../extend-api-custom-resource-definitions.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions.md b/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions.md index 39e724ae8f..d03f84254b 100644 --- a/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions.md +++ b/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions.md @@ -151,6 +151,23 @@ metadata: resourceVersion: "" selfLink: "" ``` + +## Delete a CustomResourceDefinition + +When you delete a CustomResourceDefinition, the server will uninstall the RESTful API endpoint +and **delete all custom objects stored in it**. + +```shell +kubectl delete -f resourcedefinition.yaml +kubectl get crontabs +``` + +```console +Error from server (NotFound): Unable to list "crontabs": the server could not find the requested resource (get crontabs.stable.example.com) +``` + +If you later recreate the same CustomResourceDefinition, it will start out empty. + {% endcapture %} {% capture discussion %}