Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why K8S don't support PreStart Hook

As we know, k8s supports postStart and preStop lifecycle hook, but in most cases what we need is actually preStart.

Is there any reason not implementing the preStart hook?

like image 741
Rosmee Avatar asked Oct 27 '25 07:10

Rosmee


1 Answers

look at Init containers to do preStart task.

Note:

In fact there is already a PR requested to introduce prestart and postStart hooks in pod lifecycle. It has been pending since 2014 and not much progress is seen. follow the link -> https://github.com/kubernetes/kubernetes/issues/140

like image 172
P Ekambaram Avatar answered Oct 28 '25 22:10

P Ekambaram



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!