-
Notifications
You must be signed in to change notification settings - Fork 52
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
MAX_DURATION option does not count the Pod Status Start time #77
Comments
haha, I tried to debug but I'm not familiar with go so, now, I'm not able to investigate and help further more. |
Interesting case! Given the configuration, I would have expected it to be removed at that 11 minute mark. So in this case the human readable "5 minutes after it gets evicted" doesn't translate well. I think that might require a different rule from what I originally had in mind with MAX_DURATION (which going from memory was designed to be "how long has this pod existed"). It might mean I need to implement a rule for MAX_POD_STATUS_DURATION. On the side here, I'm working to rebuild the CI/CD system for this project based on some changes that Docker made that basically broke the CD system for me. Trying to get all that worked out ASAP! Then this'll be high on my "fix or implement new!" |
Looking into this, I'm actually a bit surprised to find that there isn't (at least an obvious) timestamp about when pods shift phases at the top level. Right now, the check for eviction uses Really surprised I didn't see something like "lastPodStatusChangedTime" or something like that... |
The option MAX_DURATION option does not count the Pod Status Start time but instead the Pod Start time.
I deployed a pod with an entry point that Evicts it after 10 minutes using the command below:
sleep 600; apt update; apt install curl -y; while true; do curl http://some.url --output some.file; done
The pod reaper is configured with a MAX_DURATION of 5 minutes, POD_STATUSES with Evicted, and running every 1 minute.
I was expecting to see the pod-reaper reaping the Evicted pod at minute 15 of the POD, but instead, the POD was reaped right away at minute 11.
I took a look in the code and it is using the Pod Status start time, but looks like it is getting the first status Start time and not the pod-reaper configured.
https://github.com/target/pod-reaper/blob/master/rules/duration.go#L33
The text was updated successfully, but these errors were encountered: