mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-07-25 17:55:35 +02:00
kubectl-logs: add page (#6665)
This commit is contained in:
parent
89c1c27ff0
commit
726f064705
1 changed files with 32 additions and 0 deletions
32
pages/common/kubectl-logs.md
Normal file
32
pages/common/kubectl-logs.md
Normal file
|
@ -0,0 +1,32 @@
|
|||
# kubectl logs
|
||||
|
||||
> Show logs for containers in a pod.
|
||||
> More information: <https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#logs>.
|
||||
|
||||
- Show logs for a single-container pod:
|
||||
|
||||
`kubectl logs {{pod_name}}`
|
||||
|
||||
- Show logs for a specified container in a pod:
|
||||
|
||||
`kubectl logs --container {{container_name}} {{pod_name}}`
|
||||
|
||||
- Show logs for all containers in a pod:
|
||||
|
||||
`kubectl logs --all-containers={{true}} {{pod_name}}`
|
||||
|
||||
- Stream pod logs:
|
||||
|
||||
`kubectl logs --follow {{pod_name}}`
|
||||
|
||||
- Stream logs for a specified container in a pod:
|
||||
|
||||
`kubectl logs --follow --container {{container_name}} {{pod_name}}`
|
||||
|
||||
- Show pod logs newer than a relative time like `10s`, `5m`, or `1h`:
|
||||
|
||||
`kubectl logs --since={{relative_time}} {{pod_name}}`
|
||||
|
||||
- Show the 10 most recent logs in a pod:
|
||||
|
||||
`kubectl logs --tail={{10}} {{pod_name}}`
|
Loading…
Add table
Reference in a new issue