kubectl logs - continuously

npr picture npr · Sep 12, 2016 · Viewed 83.1k times · Source
kubectl logs <pod-id>

gets latest logs from my deployment - I am working on a bug and interested to know the logs at runtime - How can I get continuous stream of logs ?

edit: corrected question at the end.

Answer

Yu-Ju Hong picture Yu-Ju Hong · Sep 12, 2016
kubectl logs -f <pod-id>

You can use the -f flag:

-f, --follow=false: Specify if the logs should be streamed.

https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#logs