Including logs from pods in the collected output
logs collectors can be used to include logs from running pods.
This collector can be included multiple times with different label selectors and/or namespaces.
In addition to the shared collector properties, the
logs collector accepts the following parameters:
The selector to use to find matching pods. If this selector returns more than one pod, all matching pods will be collected.
The namespace to search for the pod selector in. If this is not provided, it will default to the current namespace of the context.
Name will be used to create a folder in the support bundle where logs will be saved. Name can contain slashes to create a path in the support bundle.
ContainerNames is an array of container names. If specified, logs for each container in the list will be collected. This can be omitted for pods with only one container.
Provided to limit the size of the logs.
By default, this is set to
maxLines can be provided, but not both.
The duration of the maximum oldest log to include.
The number of lines to include, starting from the newest.
apiVersion: troubleshoot.replicated.com/v1beta1 kind: Collector metadata: name: sample spec: collectors: - logs: selector: - app=api namespace: default name: api/container/logs containerNames: - api - node limits: maxAge: 720h maxLines: 1000
When this collector is executed, it will include the following files in a support bundle:
This will be created for each pod that matches the selector.