+1 vote
in Kubernetes K8s by
How many types of Container Hooks are available, and explain each one of them

1 Answer

0 votes
by

The hooks enable Containers to be aware of events in their management lifecycle and run code implemented in a handler when the corresponding lifecycle hook is executed.

There are two hooks that are exposed to Containers:

PostStart

This hook executes immediately after a container is created. However, there is no guarantee that the hook will execute before the container ENTRYPOINT. No parameters are passed to the handler. 

PreStop

This hook is called immediately before a container is terminated. It is blocking, meaning it is synchronous, so it must complete before the call to delete the container can be sent. No parameters are passed to the handler.

Related questions

0 votes
asked May 25, 2021 in Kubernetes K8s by sharadyadav1986
0 votes
asked Jan 10, 2023 in Kubernetes K8s by sharadyadav1986
...