-
Notifications
You must be signed in to change notification settings - Fork 605
Closed
Labels
LogsButtonLogsViewerdashboardgood first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.needs designSome design work needs to be done on this. Not necessarily by a designer.Some design work needs to be done on this. Not necessarily by a designer.
Description
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> --previousAPI:
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:
- kubectl logs command reference: https://kubernetes.io/docs/reference/kubectl/generated/kubectl_logs/
- Debugging running or crashing pods: https://kubernetes.io/docs/tasks/debug/debug-application/debug-running-pod/
- Logging architecture overview (includes --previous usage): https://kubernetes.io/docs/concepts/cluster-administration/logging/
- For example yaml to make a Pod terminate "termination-demo" https://kubernetes.io/docs/tasks/debug/debug-application/determine-reason-pod-failure/
This was one of the most requested features in dashboard: kubernetes-retired/dashboard#1393 https://github.com/kubernetes/dashboard/pull/2392/files and is a commonly used feature of kubectl.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
LogsButtonLogsViewerdashboardgood first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.needs designSome design work needs to be done on this. Not necessarily by a designer.Some design work needs to be done on this. Not necessarily by a designer.
Type
Projects
Status
Done