Streaming the logs

A common desire is to see a continuously flowing set of logs from your container, updated as the container provides the information. You can enable this with the -f option. For example, to see the updated logs from the Pod associated with the flask deployment, you can run the following command:

kubectl logs deployment/flask -f

As you interact with that service, or that service writes to stdout and does its normal logging, you will see the output streamed to your console.

Get Kubernetes for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.