Question 3
Domain 5: TroubleshootingWhich kubectl command would help identify the pod labeled name=cpu-burner consuming the most CPU so its name can be written to /tmp/cpu.txt?
Correct answer: A
Explanation
`kubectl top pod` shows live CPU usage for pods, and the `-l name=cpu-burner` selector limits the list to pods with that label. The `--sort-by=cpu` flag orders them by CPU usage, so the highest-consuming pod appears first and its name can be written to `/tmp/cpu.txt`.
Why each option is right or wrong
A. kubectl top pod -l name=cpu-burner --sort-by=cpu
`kubectl top pod` is the metrics command that reports current CPU/memory usage from the Metrics API, and the `-l name=cpu-burner` label selector restricts the output to only pods carrying that label. Adding `--sort-by=cpu` orders the returned pods by CPU usage, so the top entry is the one consuming the most CPU and can be redirected to `/tmp/cpu.txt` for later use.
B. kubectl get pod -l name=cpu-burner --sort-by=.spec.cpu
C. kubectl describe pod -l name=cpu-burner
D. kubectl get pods --field-selector metadata.name=cpu-burner