hjacobs/kube-janitor
Clean up (delete) Kubernetes resources after a configured TTL (time to live)
📋 Changes
- #70: also check whether a PVC is used by a `Deployment`
- #68: new CLI option `--wait-after-delete` to add a configurable wait time (default: zero) after each deletion
📋 Changes
- #61: fix a bug where CRD resources with non-preferred API version were not discovered/deleted
📋 Changes
- #65: do not delete PVCs which are referenced by Jobs or CronJobs
📋 Changes
- #64: add support for custom Python hook functions to extend `_context` (used in `jmespath` of rules)
📋 Changes
- #62: add support for removing unused Persistent Volume Claims (PVCs) with a rules file (`jmespath: "_context.pvc_is_not_mounted && _context.pvc_is_not_referenced"`)
📋 Changes
- #55: add support for `--deployment-time-annotation`
📋 Changes
- #47: change deletion propagation policy from `Foreground` to `Background` to fix Custom Resources (CRDs) which were stuck in deletion
📋 Changes
- #49: switch to poetry for dependencies and black for code formatting
- dependency updates incl. pykube-ng with IPv6 support
📋 Changes
- #42: skip non-listable API groups (e.g. unavailable API services) (thanks to @twz123)
📋 Changes
- Switch to [Calendar Versioning](http://calver.org/) with `YY.MM.MICRO` format (year, month, increment) --- this seems to be more fitting as SemVer was never really embraced (see also [this blog post](http://sedimental.org/designing_a_version.html))
- #39: allow "forever" as TTL value (to essentially disable clean up of the resource) (thanks to @antban)
📋 Changes
- #28: avoid orphaned pods for "old" deployments (i.e. not `apps/v1`) (@gree-gorey)
- #30: fix log message when deleting namespaces
📋 Changes
- #24: optionally emit a `DeleteNotification` event X seconds before the resource deletion (thanks to @angelbarrera92)
📋 Changes
- #23: use [pykube-ng](https://github.com/hjacobs/pykube) as Kubernetes client instead of the abandoned kelproject/pykube project
📋 Changes
- #6: support `janitor/expires` annotation with absolute timestamp (`YYYY-MM-DDTHH:MM:SSZ` or short `YYYY-MM-DD`) -- thanks to @SongGithub
📋 Changes
- #4: emit a `TimeToLiveExpired` event on resource deletion (needs updated RBAC for event creation)
📋 Changes
- #7: support week (``w``) as time unit for TTL and print resource age in a friendlier way
This release fixes a minor error in the log output (deletions were not shown correctly). Docker image is available on Docker Hub (see [README](https://github.com/hjacobs/kube-janitor/blob/master/README.rst) on how to use): ``` docker run -it hjacobs/kube-janitor:0.2.1 --help
📋 Changes
- #2: add `--rules-file` option to support generic rules defining TTL for Kubernetes objects based on JMESPath expressions
Initial release: allows automatic deletion of any Kubernetes resources annotated with `janitor/ttl`. Docker image is available on Docker Hub (see [README](https://github.com/hjacobs/kube-janitor/blob/master/README.rst) on how to use): ``` docker run -it hjacobs/kube-janitor:0.1 --help
