I have Kunernetes pods and replication controller running on AWS EC2 instances. If the status of pods are fail or crash then the replication controller that creates that pods has to deleted after after 5 minutes.
Basically what I want is when I run the command:
"kubectl get pods --namespace=<namespace>"
I want to consider the status column results and where ever if there is ClashloopBackOff then those pods has to be deleted after 5 minutes.
This is what I want to automate and looking forward to write a shell-script for that.