View the logs of a Kubernetes Pod

Use this command:

kubectl logs sample-pod
Also you can stream them live:
kubectl logs -f sample-pod
If there are multiple containers in the pod, you must specify container name:
kubectl logs sample-pod -c nginx