Study. uk . com
  1. Home
  2. All questions
  3. Question 472

CKA study material · question 472 of 1000

Which command lists Pods ordered by how often they have restarted?

  1. kubectl top pod --sort-by=restarts
  2. kubectl get pods -o wide --restarts
  3. kubectl get pods --sort-by='.status.containerStatuses[0].restartCount'
  4. kubectl get pods --sort-by=.status.restarts
Show the answer

Answer: C. kubectl get pods --sort-by='.status.containerStatuses[0].restartCount'

Sorting on that jsonpath ranks Pods by restart count and surfaces crash loops across a namespace.

Source: kubectl Quick Reference (Kubernetes) — Viewing and finding resources

Challenge yourself on this topic → Study as cards