TwiN / k8s-ttl-controller

Kubernetes controller that enables timed resource deletion using TTL annotation
MIT License
46 stars 6 forks source link

configurable frequency time to check for annotations and reduce logging to show only errors and objects deleted. #41

Open amjadseera opened 1 year ago

amjadseera commented 1 year ago

Describe the feature request

right now the code check every five minutes and scans for all the objects for the annotations. i would be good if can have a configurable time for it. 2023/07/27 07:18:10 Execution took 9840ms, sleeping for 5m0s 2023/07/27 07:23:19 Execution took 9752ms, sleeping for 5m0s 2023/07/27 07:28:29 Execution took 9734ms, sleeping for 5m0s 2023/07/27 07:33:30 [persistentvolumeclaims/nifi-state-nifi-0] is configured with a TTL of 5s, which means it has expired 42h54m8s ago 2023/07/27 07:33:30 [persistentvolumeclaims/nifi-state-nifi-0] deleted 2023/07/27 07:33:32 [statefulsets/nifi] is configured with a TTL of 5s, which means it has expired 18m39s ago 2023/07/27 07:33:32 [statefulsets/nifi] deleted 2023/07/27 07:33:39 Execution took 10125ms, sleeping for 5m0s

Why do you personally want this feature to be implemented?

it would be nice if its configurable or made intelligent using watch. that would

How long have you been using this project?

1 month

Additional information

abiliity to watch for annotations or a configurable frequency to check reduce logging to show only error and objects deleted.

TwiN commented 1 year ago

Good idea.

This would just involve making this configurable: https://github.com/TwiN/k8s-ttl-controller/blob/925270c76341eacca863cd84a50e53e09bf3f64a/main.go#L26

and updating the README to reflect the new feature.