Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

180
Views
View error pods which is above 5 days only

I need to get error pods above five days. The below commands is working well for the pods which is below five days. Could anyone please let me know on how to get pods which is above 5 days only. It should not show the error pods which is below 5 days.

kubectl get pods --all-namespaces --sort-by=.metadata.creationTimestamp | awk 'match($6,/^[1-4]d|^[1-900]+h|^[1-900]+m|^[1-900]+s/) {print $0}' | grep "Error" 
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I got two options for you:

kubectl get pods --sort-by=.metadata.creationTimestamp | awk 'match($5,/[6-9]d|[0-9][0-9]d|[0-9][0-9][0-9]d/) {print $0}' | grep -i error

or

kubectl get pods --field-selector=status.phase=Pending --sort-by=.metadata.creationTimestamp | awk 'match($5,/[6-9]d|[0-9][0-9]d|[0-9][0-9][0-9]d/) {print $0}'

Both will only show pods that exists for 6 days or longer. First option will also look for those with errors and the second one will show only those with the Status=Pending.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!