kind: CRD is hanging while deleting with "foregroundDeletion" policy

What happened:

I’m running a CRD controller. On the deployment of the CRD, the controller creates a set of k8s services, statefulset, role, rolebinding etc. The operator also sets the ownerReference (CRD) with ownerReference.blockOwnerDeletion=true of those objects.

Now, when I delete the CRD with foregroudDeletion policy.

CRD is hanging, I checked the dependent objects, the deletionTimestamp and finalizer are set. But somehow the garbage collector isn’t cleaning up those.

- apiVersion: v1
  kind: Service
  metadata:
    creationTimestamp: "2020-07-28T04:22:13Z"
    deletionGracePeriodSeconds: 0
    deletionTimestamp: "2020-07-28T04:23:21Z"
    finalizers:
    - foregroundDeletion

What you expected to happen:

The created services, statefulset, role, rolebinding etc. will be deleted first, and once all those are deleted by the garbage collector the CRD is removed.

Anything else we need to know?:

Also, when I described the services, I encountered warning like below:

Warning  ClusterIPNotAllocated  90s (x3 over 19m)  ipallocator-repair-controller  Cluster IP 10.102.62.89 is not allocated; repairing
Warning  FailedToUpdateEndpointSlices  18m   endpoint-slice-controller  Error updating Endpoint Slices for Service demo/topology-es-master: Error updating topology-es-master-xwwdt EndpointSlice for Service demo/topology-es-master: endpointslices.discovery.k8s.io "topology-es-master-xwwdt" not found

Environment:

$ kind version
kind v0.8.1 go1.14.2 linux/amd64

$ kubectl version --short
Client Version: v1.18.3
Server Version: v1.18.2

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (10 by maintainers)

Most upvoted comments

Btw … switching back to 1.17.x with Kind works as well.

I don’t think there’s a good workaround, there’s a fix in progress upstream. I’ve commented there.