Certified Kubernetes Application Developer (CKAD) Practice Test

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the Certified Kubernetes Application Developer (CKAD) Exam. Gain confidence with flashcards and multiple-choice questions, complete with hints and explanations. Achieve your certification with ease!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What command would you use to see the logs of a specific pod?

  1. kubectl show logs <pod>

  2. kubectl get logs <pod>

  3. kubectl logs <pod>

  4. kubectl watch logs <pod>

The correct answer is: kubectl logs <pod>

To view the logs of a specific pod in Kubernetes, the command you would use is 'kubectl logs <pod>'. This command is specifically designed for retrieving the logs that a container in a specified pod produces. It fetches the log output from the container's standard output (stdout) and standard error (stderr), allowing developers and operators to diagnose issues or monitor the behavior of applications running within the Kubernetes cluster. The 'kubectl logs <pod>' command is versatile; it can be used to view logs from a pod with a single container or specify which container to view in a pod that has multiple containers. This is particularly useful in a microservices architecture where multiple components are deployed as separate containers within the same pod. In contrast, the other commands do not perform this specific action. For instance, 'kubectl show logs <pod>' does not exist in Kubernetes, which means it would not execute successfully. Similarly, 'kubectl get logs <pod>' does not align with the Kubernetes command structure; 'get' is used for listing resources rather than fetching logs. Lastly, 'kubectl watch logs <pod>' is not a valid command either since Kubernetes doesn't support the 'watch' aspect directly applied to logs retrieval in that manner. Thus,