In docker,
docker run -d <imagename>
To view the logs
docker logs -f <containerId>
-f
option helps us to stream the logs live
In Kubernetes,
kubectl create -f <yaml-filename>
To view the logs
kubectl logs -f <podname>
Use -f
to stream the logs live.
These logs are specific to the container running inside the pod.
In case of multiple container pod, we must explicitly specify name of the container in the command.
kubectl logs -f <podname> <containername>