lwolf / kube-cleanup-operator

Kubernetes Operator to automatically delete completed Jobs and their Pods
MIT License
498 stars 109 forks source link

Pending pods don't get cleaned up #51

Closed patrungel closed 4 years ago

patrungel commented 4 years ago

Pods in the pending state get never cleaned up.

How to reproduce:

  1. Configure kube-cleanup-operator to clean up pending pods:

    ...
    -delete-pending-pods-after=3m
    ...
  2. Launch a pod that will never get scheduled (tested with a job and with a standalone pod). For instance:

    ...
    nodeSelector:
    feature: dummy
    ...
  3. Wait until the retention is due.

Expected: the pending pod is deleted Actual result: the pod is not deleted

Current configuration as logged:

2020/06/23 16:12:31 Provided options: 
    namespace: test-cleanup
    dry-run: false
    delete-successful-after: 3m0s
    delete-failed-after: 3m0s
    delete-pending-after: 3m0s
    delete-orphaned-after: 3m0s
    delete-evicted-after: 3m0s

    legacy-mode: false
    keep-successful: 0
    keep-failures: -1
    keep-pending: -1
lwolf commented 4 years ago

what's the k8s version?

patrungel commented 4 years ago

1.15

sorinjulean commented 4 years ago

Can be reproduced for version 1.18.4

lwolf commented 4 years ago

Yeah, thanks, working on a fix