-
Notifications
You must be signed in to change notification settings - Fork 53
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
Pod unready rule #40
Pod unready rule #40
Conversation
Hey! Awesome of you to open up a PR! I'm curious if the use case you're thinking of is the use case that came to my mind when I saw the PR. I was thinking of this as being something like a globally defined liveness probe for all pods on a cluster. It seems like it does something very similar to the liveness probes of a pod spec, but pod-reaper can have significantly more scope, so I was wondering if that's what you're thinking of! |
@brianberzins Yes, this is a liveness probe to kill pods with containers that are passing the built-in liveness probe, but failing the readiness probe for an extended period of time. We encountered an issue in one of our applications where the running container would get disconnected from the database, and be unable to reconnect. When this happens, Kubernetes will stop routing traffic to the pod when the readiness probe fails. If it remains in that state for 10 minutes, we have pod reaper kill it. |
Looking to test this out this afternoon/evening! |
This looks great! I really feel like I should setup an automated way of testing this out against a live cluster. Until then, I'm pretty paranoid about making sure this thing works exactly as I expect it to because of what it can do. So here's what I did to test it out!
I deployed all of this - and made sure the reaper found/killed them!
With logs:
|
@slushpupie |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I built and tested this out locally (I'm on the paranoid side with this thing!)
Everything good!
Appreciate the style match, even if my go code isn't amazing!
Thanks again for the pull-request! |
@brianberzins No problem. Thank you for pod reaper. It saved me from having to write something from scratch. It would be nice to be able to override pod-reaper settings with labels. For example if |
@jdharmon Huh! That's something I haven't thought about before. I just went down a rabbit hole in my head! If you're up for it, I think I'll make another issue for this sometime soon and bounce some possible implementations ideas your way to see if any of them make sense to you! |
Would you propose that the pod defined label(s) should always override the pod-reaper defined behavior? Feels like a minimum the default behavior should be to ignore pod defined labels unless a configuration option has been defined on pod-reaper. Suppose you could also go as granular as to define certain "whitelist" of options that pods are allowed to override. |
Created issue #44 so discussion is not lost in this PR. |
Rule flags pods for reaping based on the time a pod has been unready.