kopf icon indicating copy to clipboard operation
kopf copied to clipboard

CRD deletion takes more than 30 seconds

Open Antaxify opened this issue 3 years ago • 0 comments

Question

I wrote an operator that creates some k8s resources (deployment, service, ingress) and used kopf.adopt to automate deletion. However, the operator takes more than 30 seconds to start deleting the resources, even if I 'manually' delete the resources in the deletion handler.

Removing kopf.adopt in favor of deletion in a deletion handler did not fix the issue, the CRD still takes more than 30 seconds to delete, even if nothing should be left to do.

According to the logs, the deletion handler finished the moment I started deleting the CRD.

If I manually remove the finalizer, the crd gets deleted instantly.

Should I delete the finalizer in the deletion handler? Am I missing something? Is there a reason why it takes so long?

EDIT: This behavior seems to occur because I use a daemon to monitor the CRD. I use the while not stopped: snippet from the documentation and according to the logs the daemon terminates a seconds after CRD deletion. Replacing the daemon with a timer fixed the issue, although it's cluttering the logs quite a bit now.

Checklist

  • [x] I have read the documentation and searched there for the problem
  • [x] I have searched in the GitHub Issues for similar questions

Keywords

termination

Antaxify avatar Jul 06 '21 10:07 Antaxify