deleting pods using kubernetes replication controller

0 votes

I am running a replication controller on aws ec2 instances. I want the pods to get deleted after 5 minutes if they crash, fail or stop. When we run the:

kubectl get pods --namespace=<namespace>

I want it to check the status column and if there's a ClashloopBackOff for any pod, then it needs to be deleted after 5 minutes. How can I do this?

Jul 24, 2018 in Kubernetes by shubham
• 6,910 points
455 views

1 answer to this question.

0 votes

The pods which are managed by ReplicationController try and stay healthy. If the pod crashes it's replicated and started again. But if the same pod is crashing again and again then thte time to be replicated is incrementally increased. eg. first time it'll be 30 seconds, second time 1 minute, third 2 minutes and so on.

answered Jul 24, 2018 by DareDev
• 6,870 points

Related Questions In Kubernetes

+1 vote
1 answer

kubernetes ingress controller and resource using nginx

Ingress is just collection of rules that forwards ...READ MORE

answered Sep 12, 2018 in Kubernetes by Kalgi
• 51,970 points
575 views
0 votes
1 answer
0 votes
2 answers

Access Kubernetes API using minKube

Try these commands: kubectl proxy --port=8080 You can then ...READ MORE

answered Aug 28, 2018 in Kubernetes by Hannah
• 18,410 points
682 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
9,134 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 11, 2019 in Kubernetes by Kalgi
• 51,970 points

reshown Apr 12, 2019 by Kalgi 2,778 views
0 votes
3 answers

Using multiple commands in a kubernetes yaml file

Try something like this: containers: - name: ...READ MORE

answered Apr 23, 2019 in Kubernetes by lyza
19,068 views
0 votes
1 answer