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,800 points
168 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,810 points

Related Questions In Kubernetes

0 votes
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
• 37,320 points
251 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
• 14,080 points
188 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,058 views
+3 votes
1 answer
0 votes
3 answers

Using multiple commands in a kubernetes yaml file

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

answered Apr 23 in Kubernetes by lyza
3,429 views
0 votes
1 answer