calico icon indicating copy to clipboard operation
calico copied to clipboard

HostEndpoint objects remain after calico node is deleted when DATASTORE_TYPE is kubernetes

Open sp-yduck opened this issue 9 months ago • 1 comments

related issue : #4015 by addressing issue #4015, HostEndpoint objects are deleted after calico node is deleted if we use etcd datastore type. however in kubernetes datastore type, they are still remain. (as NodeDeletionController is registered only when the datastore type is etcd. (sorry if I my understanding is wrong)) I am not sure if hep should be automatically deleted by calico though, it would be great if calico can take care of their deletion.

Expected Behavior

HostEndpoint objects associated with the deleted Node should be deleted after the Node is deleted

Current Behavior

HostEndpoint objects associated with the deleted Node are not deleted after the Node is deleted

Possible Solution

Delete them

Steps to Reproduce (for bugs)

  1. create a k8s cluster with calico in kuberneted datastore type
  2. provision worker node and create HostEndpoint associated with it
  3. delete that worker node and check if HostEndpoint is deleted
  4. after k8s node deletion, calico node is also deleted but HostEndpoint still remains

Context

Your Environment

  • Calico version : v3.26
  • Orchestrator version (e.g. kubernetes, mesos, rkt): k8s v1.28
  • Operating System and version:
  • Link to your project (optional):

sp-yduck avatar May 15 '24 00:05 sp-yduck

One way we might consider doing this is simply using OwnerReferences to leverage Kubernetes garbage collection of child resources.

caseydavenport avatar May 20 '24 17:05 caseydavenport