Which of the following will view the snapshot of previously terminated ruby container logs from Pod web-1?
Which of the following will view the snapshot of previously terminated ruby container logs from Pod web-1?
To view the snapshot of previously terminated logs of a specific container within a pod, the correct syntax is needed. The command to achieve this entails specifying the previous logs with '-p' and the target container with '-c'. Therefore, the correct command is kubectl logs -p -c ruby web-1, which accurately specifies that it refers to the previous logs of the 'ruby' container in the 'web-1' pod.
-p previous -c container
https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#logs: -- Return snapshot of previous terminated ruby container logs from pod web-1 kubectl logs -p -c ruby web-1
Return snapshot of previous terminated ruby container logs from pod web-1 kubectl logs -p -c ruby web-1 https://jamesdefabia.github.io/docs/user-guide/kubectl/kubectl_logs/
The correct syntax should be the following: kubectl logs web-1 -c ruby Check https://kubernetes.io/docs/reference/kubectl/quick-reference/#interacting-with-running-pods