Closed gjacquet closed 9 months ago
Configuring lifecycle is totally valid, but be warned that we build Refinery from the scratch
image
I never noticed that before I guess 😅
This will still come in handy in the near future since Kubernetes 1.29 is introducing a sleep feature to the lifecycle to make this work with scratch based image: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-implementations
However it is still behind a feature gate in kube 1.29 and in alpha status... Maybe it will be more widely available with kube 1.30
Is your feature request related to a problem? Please describe. To make rolling update smoother, it is very common to add a sleep to containers preStop lifecycle to give Kubernetes some time to reconfigure the application's service endpoints.
You can find more details there: https://blog.gruntwork.io/delaying-shutdown-to-wait-for-pod-deletion-propagation-445f779a8304
Describe the solution you'd like
It should be possible to configure each container's lifecycle to accomodate the use case decribed above but this could possibly be used in other cases too.
Describe alternatives you've considered
Additional context