kubernetesgoogle-kubernetes-enginekubectl

kubectl logs - continuously


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.


Solution

  • 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