exam questions

Exam KCNA All Questions

View all questions & answers for the KCNA exam

Exam KCNA topic 1 question 20 discussion

Actual exam question from Linux Foundation's KCNA
Question #: 20
Topic #: 1
[All KCNA Questions]

Which is the correct kubectl command to display logs in real time?

  • A. kubectl logs -p test-container-1
  • B. kubectl logs -c test-container-1
  • C. kubectl logs -l test-container-1
  • D. kubectl logs -f test-container-1
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
dadaarce
3 months, 1 week ago
Selected Answer: D
The -f or --follow flag is used to stream logs in real time.
upvoted 2 times
...
phcunha
3 months, 2 weeks ago
D. kubectl logs -f test-container-1 Explanation: The -f flag in the kubectl logs command stands for "follow," which allows you to continuously stream the logs in real-time as new log entries are added. This is useful for monitoring applications or troubleshooting issues as they occur. An analogy for this command could be tuning in to a live radio broadcast. When you listen to a live radio show, you want to hear the content as it's being broadcasted, rather than just a recording of past broadcasts. Similarly, using kubectl logs -f lets you "tune in" to the ongoing activity of a container, receiving log updates in real-time.
upvoted 1 times
...
nvtienanh
9 months, 1 week ago
Selected Answer: D
D is correct
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago