Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seiso should be able to cleanup generic resources #38

Open
ccremer opened this issue Aug 10, 2020 · 2 comments
Open

Seiso should be able to cleanup generic resources #38

ccremer opened this issue Aug 10, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@ccremer
Copy link
Contributor

ccremer commented Aug 10, 2020

There's currently the seiso configmaps and seiso secrets feature.
The recent restructuring however looks very similar for both resource types: They watch the .metadata.creationTimestamp and .metadata.labels to decide whether to clean up objects. The internal logic is often reused for both resources.

However, those metadata is available to pretty much every object. I'd propose to use the dynamic client so that we can cleanup any kind of resources, even custom CRDs:

seiso cleanup secrets --older-than 1w --selector key=value
seiso cleanup pods --selector app=foo
seiso cleanup apps/v1/deployment --selector app=bar
seiso cleanup certmanager.k8s.io/v1alpha1/order --selector app.kubernetes.io/name=operator

Image tags need somewhat more sophisticated logic (and for generic registries they don't have the same metatdata), there I would keep the current feature.

@ccremer ccremer added the enhancement New feature or request label Aug 11, 2020
@bittner
Copy link
Contributor

bittner commented Sep 22, 2020

This is a fantastic idea!

With respect to the command's name, I'd suggest to use something else though, as "seiso" already has the meaning of "cleanup". Maybe seiso generic is just good enough. It would say, "clean up a generic resource" (as opposed to a container image).

@ccremer
Copy link
Contributor Author

ccremer commented Sep 22, 2020

I think the command usage is personal interpretation. Yes, Seiso means "cleanup" already so the second argument becomes redundant, but it could also be just regarded as the project name or binary name, and then the command usage feels more "english" and imperative when reading seiso, (please) cleanup secrets --older-than 1w.

But I have no hard feelings here, I'm fine with either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants