kor
kor copied to clipboard
Feature: skip expected replicaSets from deployments and statefulsets, as well as jobs from cronjobs
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
orall
for example. - This actually would be a different feature request to be able to give a list of objects, egcronjobs,deployments
instead ofall
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