From e8429009528fab31b4288b119c310e30d40f0cf0 Mon Sep 17 00:00:00 2001 From: Mark Mandel Date: Fri, 29 Dec 2017 11:30:07 -0800 Subject: [PATCH] Expand on Finalizer explanation. This just expands on the explanation of a Finalizer and how to interact with it within a controller. --- .../extend-api-custom-resource-definitions.md | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) 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 f92daf114a..fa4cb453fe 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 @@ -192,12 +192,22 @@ metadata: - finalizer.stable.example.com ``` -The first delete request on an object with finalizers merely sets a value for the -`metadata.deletionTimestamp` field instead of deleting it. -This triggers controllers watching the object to execute any finalizers they handle. +Finalizers are arbitrary string values, that when present ensure that a hard delete +of a resource is not possible while they exist. -Each controller then removes its finalizer from the list and issues the delete request again. -This request only deletes the object if the list of finalizers is now empty, +The first delete request on an object with finalizers merely sets a value for the +`metadata.deletionTimestamp` field instead of deleting it. Once this value is set, +entries in the `finalizer` list can only be removed. + +This triggers controllers watching the object to execute any finalizers they handle. +This will be represented via polling update requests for that +object, until all finalizers have been removed and the resource is deleted. + +The time period of polling update can be controlled by `metadata.deletionGracePeriodSeconds`. + +It is the responsibility of each controller to removes its finalizer from the list. + +Kubernetes will only finally delete the object if the list of finalizers is empty, meaning all finalizers are done. ### Validation