kor icon indicating copy to clipboard operation
kor copied to clipboard

Feature: skip expected replicaSets from deployments and statefulsets, as well as jobs from cronjobs

Open mpatters72 opened this issue 7 months ago • 5 comments

Problem: I don't want to alert/include standard replicasets associated with deployments, statefulsets in a report /slack message as this distracts from what I consider truly orphaned resources. Similarly I'd like to be able to keep expected jobs from cronjobs.

  • A deployment/statefulset that has been updated, may keep around old replicasets up the spec/revisionHistoryLimit (default 10)

  • We set revisionHistoryLimit so we have some rollback options / history

  • Jobs that were launched by a cronJob can be useful to checking logs on last successful run. In my team we tune jobs-history-limits to keep last successful and last falied.

Describe the solution you'd like

  • Flag to skip replicasets currently associated with deployments/statefulsets (or alternatively last X number)

  • Configmaps/secrets associated with those replicasets skipped also (can't rollback if it is removed)

Describe alternatives you've considered

  • Add labels to everything and filter out that way. Impractical for the very large number of services and namespaces we use, and eventually things no longer needed.

  • Don't include replicasets in report. I'm only aware of the command referencing the specific object eg replicasets or all for example. - This actually would be a different feature request to be able to give a list of objects, eg cronjobs,deployments instead of all or just 1 object to the command.

  • For cronjobs I could probably use --older-than flag to ignore jobs from more recent runs.

Additional context

mpatters72 avatar Aug 03 '24 00:08 mpatters72