Skip to content

View crashed Pod logs (previous logs) #3225

Open
@illume

Description

@illume

When I am troubleshooting a Pod that has crashed or restarted, I want to be able to view the logs from its previous container instance, so I can understand what caused the failure and take corrective action.

With kubectl you can see the logs for a crashed Pod like this:

kubectl logs <pod-name> --previous
kubectl logs <pod-name> -c <container-name> --previous

API:

GET /api/v1/namespaces/{namespace}/pods/{pod}/log?previous=true

previous=true: fetches logs from the previous container instance, which is useful when the container has crashed or restarted.

We need to design and agree a UI before implementation:

  • Maybe an option on the log viewer page?
  • Or a separate action "View previous logs" button?

Additional context

See:

This was one of the most requested features in dashboard: kubernetes/dashboard#1393 https://github.com/kubernetes/dashboard/pull/2392/files and is a commonly used feature of kubectl.

Metadata

Metadata

Labels

LogsButtonLogsViewerdashboardgood first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.needs designSome design work needs to be done on this. Not necessarily by a designer.

Type

No type

Projects

Status

Queued

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions