Unfortunately, containers will still receive SIGKILL after terminationGracePeriodSeconds have elapsed, regardless of the preStop hook, which is just used to delay the initial SIGTERM sent for graceful termination.
With the current wording of this note, I thought for a moment that the preStop hook would take precedence over terminationGracePeriodSeconds and preventing Kubernetes from sending SIGKILL until the hook finished running.
Since https://github.com/kedacore/keda-docs/pull/265, the documentation provides a note stating that the
preStop
hook can be used to delay termination:https://github.com/kedacore/keda-docs/blob/5ef378ea14b1bc2a9e90bc05e492b2ebed3faafa/content/docs/1.5/concepts/scaling-deployments.md?plain=1#L107
Unfortunately, containers will still receive
SIGKILL
afterterminationGracePeriodSeconds
have elapsed, regardless of thepreStop
hook, which is just used to delay the initialSIGTERM
sent for graceful termination.With the current wording of this note, I thought for a moment that the
preStop
hook would take precedence overterminationGracePeriodSeconds
and preventing Kubernetes from sendingSIGKILL
until the hook finished running.