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, 2019 in Kubernetes by Sam
• 6,260 points
1,901 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, 2019 by Sirajul
• 59,230 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, 2019 in Kubernetes by Kim
1,278 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, 2019 in Kubernetes by Sirajul
• 59,230 points
3,453 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

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

answered Jan 17, 2019 in Others by anonymous
14,610 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,360 points

reshown Apr 12, 2019 by Kalgi 6,095 views
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, 2019 in Kubernetes by Sirajul
• 59,230 points
2,031 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, 2019 in Kubernetes by Sirajul
• 59,230 points
1,128 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP