honeycombio / helm-charts

Helm repository and charts for Honeycomb
Apache License 2.0
29 stars 38 forks source link

[refinery] Add lifecycle configuration to container #341

Closed gjacquet closed 8 months ago

gjacquet commented 8 months ago

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

TylerHelmuth commented 8 months ago

Configuring lifecycle is totally valid, but be warned that we build Refinery from the scratch image

gjacquet commented 8 months ago

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