nats-io / nack

NATS Controllers for Kubernetes (NACK)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Resource Deletion

caleblloyd opened this issue · comments

I am trying to understand the history of #56 with respect to this comment:

With finalizers gone, the Kubernetes Informers no longer send us an event when a resource is deleted

Why are finalizers gone? They are still documented as supported for CRDs:

https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#finalizers

Managed resource deletion in k8s is typically handled in finalizers, not a list/cleanup loop like was implemented in #56. Or at least it was 1-2 years ago, it has been a while since I worked on an Operator so have things changed? Or should we go back to using finalizers here?

The cleanup loop got added in order to avoid this deadlock that can happen when deleting CRDs, for which the workaround is to issue a kubectl patch command to remove the finalizers when deleting: kubernetes/kubernetes#60538 (comment)