improve structure of finalizer section in CRD guide (#24851)
- It's now more precise regarding the format of finalizers (which have to consist of a namespace and a name, separated by a forward slash or they will get rejected by the apiserver, with the exception of built in ones) - It's less repetitve in generalpull/24889/head^2
parent
0b222bd47c
commit
8c68745c0f
|
@ -518,27 +518,25 @@ apiVersion: "stable.example.com/v1"
|
||||||
kind: CronTab
|
kind: CronTab
|
||||||
metadata:
|
metadata:
|
||||||
finalizers:
|
finalizers:
|
||||||
- finalizer.stable.example.com
|
- stable.example.com/finalizer
|
||||||
```
|
```
|
||||||
|
|
||||||
Finalizers are arbitrary string values, that when present ensure that a hard delete
|
Identifiers of custom finalizers consist of a domain name, a forward slash and the name of
|
||||||
of a resource is not possible while they exist.
|
the finalizer. Any controller can add a finalizer to any object's list of finalizers.
|
||||||
|
|
||||||
The first delete request on an object with finalizers sets a value for the
|
The first delete request on an object with finalizers sets a value for the
|
||||||
`metadata.deletionTimestamp` field but does not delete it. Once this value is set,
|
`metadata.deletionTimestamp` field but does not delete it. Once this value is set,
|
||||||
entries in the `finalizers` list can only be removed.
|
entries in the `finalizers` list can only be removed. While any finalizers remain it is also
|
||||||
|
impossible to force the deletion of an object.
|
||||||
|
|
||||||
When the `metadata.deletionTimestamp` field is set, controllers watching the object
|
When the `metadata.deletionTimestamp` field is set, controllers watching the object execute any
|
||||||
execute any finalizers they handle, by polling update requests for that
|
finalizers they handle and remove the finalizer from the list after they are done. It is the
|
||||||
object. When all finalizers have been executed, the resource is deleted.
|
responsibility of each controller to remove its finalizer from the list.
|
||||||
|
|
||||||
The value of `metadata.deletionGracePeriodSeconds` controls the interval between
|
The value of `metadata.deletionGracePeriodSeconds` controls the interval between polling updates.
|
||||||
polling updates.
|
|
||||||
|
|
||||||
It is the responsibility of each controller to remove its finalizer from the list.
|
Once the list of finalizers is empty, meaning all finalizers have been executed, the resource is
|
||||||
|
deleted by Kubernetes.
|
||||||
Kubernetes only finally deletes the object if the list of finalizers is empty,
|
|
||||||
meaning all finalizers have been executed.
|
|
||||||
|
|
||||||
### Validation
|
### Validation
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue