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

Add Label Selector to available parameters #71

Merged
merged 3 commits into from
Mar 28, 2021
Merged

Conversation

RocketRaccoon
Copy link
Contributor

@RocketRaccoon RocketRaccoon commented Mar 16, 2021

It can be useful to manage jobs/pods in the same namespace by different rules. It is easy to achieve by running several kube-cleanup-operator instances with different label selectors. This PR supports such ability.
I didn't add any tests because it is functionality of underlying library, but have tested manually with empty value and something like --label-selector=component=worker,housekeeping=true

@lwolf
Copy link
Owner

lwolf commented Mar 20, 2021

Hi, is there a specific use case that you're trying to solve here? Could you tell me more abou it please?

@RocketRaccoon
Copy link
Contributor Author

I have "infra" namespace which manages lot of different jobs e.g. ones run small scripts and other execute long-running terraform tasks. I need to manage their cleanup in different ways, small one should be cleaned up in 5 minutes and long tasks should keep their log for 24 hours. I want to have some kind of ownership for different flows.

@lwolf
Copy link
Owner

lwolf commented Mar 22, 2021

I see, thanks for the info. Originally I planned to support this use case by introducing job/pod annotations.
Let me think about it.

@RocketRaccoon
Copy link
Contributor Author

RocketRaccoon commented Mar 22, 2021

Annotations probably work better here, labels were just easy and fast option for me. I can rework it if you need.

@lwolf
Copy link
Owner

lwolf commented Mar 22, 2021

If you're interested in implementing it - that's awesome.

Before the rework, we need to come up with a list of annotations to use and the workflow that won't break anything.
I'm a bit oversubscribed at the moment, but I'll try to come up with some ideas for the annotations over weekend. If you have any - please post to the ticket that I just created - #72

Let's leave the PR open for now, we might decide along the way that it not worth it and go with the labels instead.

@lwolf
Copy link
Owner

lwolf commented Mar 28, 2021

I think it doesn't contradict annotation-based customizations. Merging.
Thank you!

@lwolf lwolf merged commit e709a88 into lwolf:master Mar 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants