Question No 6 Which command is used to get the logs of the nodes running in a Kubernetes kubectl log kubectl get logs kubelet logs kubectl logs

Correct Answer:

kubectl get logs

Analyzing the Answer:

The command kubectl get logs is used to retrieve logs from containers running in a Kubernetes cluster. It’s a standard Kubernetes command and is the correct way to access container logs.

Analysis of other options:

○ kubectl log: This is an incomplete command. kubectl needs a verb (like get, describe, delete, etc.) to specify the action.

○ kubelet logs: kubelet is the agent running on each node in the Kubernetes cluster. It doesn’t have a direct command-line interface for retrieving logs like kubectl does. You interact with the kubelet indirectly through kubectl.

○ kubectl logs: Similar to the first incorrect option, this is also an incomplete command. It lacks the necessary get verb to specify the action.

Read more here: Source link