CmdID

CmdID / Commands

kubectl-logs

Show logs for containers in a pod. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

Show logs for a single-container pod

kubectl logs pod_nameIdentify

Show logs for a specified container in a pod

kubectl logs --container container_name pod_nameIdentify
--containerPrint the logs of this container kubectl reference

Show logs for all containers in a pod

kubectl logs --all-containers=true pod_nameIdentify
--all-containersGet all containers' logs in the pod(s). kubectl reference

Stream pod logs

kubectl logs --follow pod_nameIdentify
--followSpecify if the logs should be streamed. kubectl reference

Show pod logs newer than a relative time like 10s, 5m, or 1h

kubectl logs --since relative_time pod_nameIdentify
--sinceOnly return logs newer than a relative duration like 5s, 2m, or 3h. kubectl reference

Show the 10 most recent logs in a pod

kubectl logs --tail 10 pod_nameIdentify
--tailLines of recent log file to display. kubectl reference

Show all pod logs for a given deployment

kubectl logs [deploy/deployment_nameIdentify