What are the container hooks available in kubernetes?

0 votes
How many types of container lifecycle hooks are supported in kubernetes? could you explain them?
Jul 15 in Kubernetes by Sam
• 2,140 points
27 views

1 answer to this question.

0 votes

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.

For further understanding of these you could have a look: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/

answered Jul 15 by Sirajul
• 30,140 points

Related Questions In Kubernetes

0 votes
1 answer
0 votes
1 answer

What are selector based selectors in Kubernetes?

This type of selector allows filtering keys ...READ MORE

answered Apr 17 in Kubernetes by Kim
121 views
0 votes
1 answer

What is the difference between config map and secret in kubernetes?

Config maps ideally stores application configuration in ...READ MORE

answered Jul 17 in Kubernetes by Sirajul
• 30,140 points
95 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17 in Others by anonymous
2,569 views
+3 votes
1 answer
0 votes
1 answer

Kubernetes: What are the types of multi-container pod patterns?

Here are the different types of multi-container ...READ MORE

answered Jul 17 in Kubernetes by Sirajul
• 30,140 points
37 views
0 votes
1 answer

What all components is the Master server in Kubernetes made up of?

Kubernetes is a combination of multiple parts ...READ MORE

answered Jul 11 in Kubernetes by Sirajul
• 30,140 points
79 views