Prevent pod from shutting down immediately - Kubernetes

0 votes
How do I prevent Kubernetes pod from shutting down immediately? My ingress needs to know that my pod is going to stop before it can stop sending traffic to it.
Jul 25 in Kubernetes by Laya
26 views

1 answer to this question.

0 votes
The easiest way out is to prevent the pod from shutting immediately. This is possible with a preStop hook. Adding in a preStop hook to the deployment which does sleep 5 should delay the pod termination long enough to let the Ingress update and remove the disabled pod from its upstream list.
answered Jul 25 by Mercilia

Related Questions In Kubernetes

0 votes
1 answer

Not able to access kubernetes api from a pod in azure

Follow these steps Add --bind-address=0.0.0.0 option to the line https://github.com/kubernetes/kubernetes/blob/v1.2.0/docs/getting-started-guides/coreos/azure/cloud_config_templates/kubernetes-cluster-main-nodes-template.yml#L218  Created ...READ MORE

answered Aug 30, 2018 in Kubernetes by Kalgi
• 39,330 points
50 views
0 votes
1 answer

How can I access a service installed on Kubernetes from anywhere?

I have followed the link which you have ...READ MORE

answered Jul 23, 2018 in Kubernetes by Atul
• 10,240 points
116 views
0 votes
1 answer

Kubernetes error syncing pod

The issue caused by the docker container ...READ MORE

answered Aug 27, 2018 in Kubernetes by Kalgi
• 39,330 points
669 views
0 votes
1 answer

Define pod yaml dynamically-jenkins pipeline Kubernetes

Try using jinja template engine and python ...READ MORE

answered Aug 28, 2018 in Kubernetes by Kalgi
• 39,330 points
143 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
1,680 views
+3 votes
1 answer
0 votes
2 answers

Access Kubernetes api from within a pod container

wget version: KUBE_TOKEN=$(</var/run/secrets/kubernetes.io/serviceaccount/token) wget -vO- ...READ MORE

answered Aug 29, 2018 in Kubernetes by Nilesh
• 6,900 points
236 views
0 votes
3 answers

Retry pull image in a kubernetes pod

If the Pod is part of a ...READ MORE

answered Aug 29, 2018 in Kubernetes by Hannah
• 14,090 points
901 views