News for hackers. Stuff that matters.
Re:StatefulSet: Run and Scale Stateful Applications Easily i... by philips on Tuesday December 20, 2016 @07:41PM (#13225790)
See Pod lifecycle and handler:

http://kubernetes.io/docs/api-reference/v1/definitions/#_v1_...

http://kubernetes.io/docs/api-reference/v1/definitions/#_v1_...

edit: As soon I posted this I remembered this is a feature; deleted original hack. :)

Re:StatefulSet: Run and Scale Stateful Applications Easily i... by smarterclayton on Wednesday December 21, 2016 @02:07AM (#13227348)
You can use a combination of these to set a long grace period, and then have your pre-stop hook wait for your process to finish (whatever criteria you define as finished).

We chose to set a fixed upper bound to ensure outside administrators can observe the requested grace period when draining nodes or performing maintenance.