lwolf / kube-cleanup-operator

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

cleanup also pods completed #57

Closed haarchri closed 4 years ago

haarchri commented 4 years ago

hello, is it possible to get more function that we can also cleanup pods wich are completed for configurable time ?

lwolf commented 4 years ago

could you explain your usecase?

haarchri commented 4 years ago

We have a lot of pods in an OpenShift Environment (Build Pods) wich are in Status Completed but not auto removed from Cluster - so it would great to See that the cleanup pod can also remove those

lwolf commented 4 years ago

depends on who owne those pods and how they were created, you might be able to clean those by using

-delete-orphaned-pods-after duration
        Delete orphaned pods. Pods without an owner in non-running state (golang duration format, e.g 5m), 0 - never delete
haarchri commented 4 years ago

looks like the pods have a owner reference:

  ownerReferences:
    - apiVersion: build.openshift.io/v1
      controller: true
      kind: Build
lwolf commented 4 years ago

sounds like your build system should be responsible for removing those pods.