get_k8s_logs
Gets logs from a Kubernetes container in a pod. This is similar to running kubectl logs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Required. The name of the resource to retrieve logs from. This can be a pod name (e.g. "my-pod") or a type/name (e.g. "deployment/my-deployment"). If a type is not specified, "pod" is assumed. | |
| tail | No | Optional. The number of lines from the end of the logs to show. | |
| since | No | Optional. Retrieve logs since this duration ago (e.g. "1h", "10m"). | |
| parent | Yes | Required. The cluster to retrieve logs from. Format: projects/{project}/locations/{location}/clusters/{cluster} | |
| previous | No | Optional. If true, retrieve logs from the previous instantiation of the container. | |
| container | No | Optional. The name of the container to retrieve logs from. If not specified, logs from the first container are returned. | |
| namespace | No | Optional. The namespace of the resource. If not specified, "default" is used. | |
| sinceTime | No | Optional. Retrieve logs since this time (RFC3339). e.g. "2024-08-30T06:00:00Z". | |
| timestamps | No | Optional. If true, include timestamps in the log output. | |
| allContainers | No | Optional. If true, retrieve logs from all containers in the pod. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| logs | No | The logs from the resources. | |
| errors | No | Errors encountered during log retrieval. |