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, 2019 in Kubernetes by Laya
55 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, 2019 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
• 50,840 points
101 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,250 points
176 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
• 50,840 points
1,128 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
• 50,840 points
280 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, 2019 in Others by anonymous
4,314 views
+3 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 11, 2019 in Kubernetes by Kalgi
• 50,840 points

reshown Apr 12, 2019 by Kalgi 1,165 views
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,920 points
452 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
• 17,750 points
1,494 views