Pod logs¶
Collecting pod logs can help understand what happened inside one or more pods.
Configuration¶
Reference documentation
- The full structure of the
PodLogs
resource is documented here.
All namespaces¶
When used with a namespaced resource, it is possible to consider all namespaces in the cluster by setting namespace: '*'
.
Usage examples¶
Single pod¶
If a pod name
is specified, Chainsaw will retrieve logs from this specific pod in the test namespace.
Collect pod logs in the test namespace
If a namespace
is specified, Chainsaw will retrieve logs from this specific pod in the specified namespace.
Collect pod logs in a specific namespace
All pods¶
If no pod name
and namespace
is specified, Chainsaw will retrieve logs from all pods in the test namespace.
Collect all pod logs in the test namespace
On the other hand, if a namespace
is specified, Chainsaw will retrieve logs from all pods in the specified namespace.
Collect all pod logs in a specific namespace
Label selector¶
An optional label selector can be configured to refine the pods to retrieve logs from.
Collect pod logs using a label selector in the test namespace
If a namespace
is specified, Chainsaw will retrieve pod logs using the specified namespace.
Collect pod logs using a label selector in a specific namespace
Tail¶
The tail
field can be used to limit the amount of log lines retrieved when querying pod logs.
Default
By default, tail
will be 10
when a label selector is used, and all
if a pod name
is specified.
Tail example
Container¶
The container
field can be used to retrieve logs from a specific container in the pod.
Default
By default logs from all containers will be fetched.