Kubernetes Pod Logs
A common need to utilize the Kubernetes dashboard is to review pod logs. This can be used to debug why a pod is restarting, failing to start, or check in on its health or activity.
We can provide this experience directly within GitLab, for the cluster that is integrated.
I have proposed 2 phases of the MVC. We should get the initial MVC submitted and reviewed as an MR, but it would be ideal if we could continue on and get MVC.2 also finished in the same release. Without support for multi-container pods, a lot of users will see errors when trying to use it.
MVC Proposal
- The Pod log screen can be a dedicated screen to show the logs. An example of kubectl's view is below.
- Entrypoint would be from Deploy Boards, once pod tracking ships.
- For the absolute MVC, we would only support pods with a single container.
- For this first release, not required to do a live view of the logs. Page reload will refresh the logs.
- We should try to load a healthy amount of log data, since we will not support pagination.
MVC.2 Proposal
- Retrieve the list of containers within the selected pod. Show a dropdown populated with that list. Automatically select and display the logs for the first alphabetical container.
- Add a refresh button to refresh the logs.
Future pod log enhancements
- Show
previous
pod logs (i.e. if the pod is crash looping, retrieve the now dead pod logs) - Streaming pod logs (e.g. tail -f)
- Pagination of pod logs
Design
Design specs: https://gitlab-org.gitlab.io/gitlab-design/hosted/hazel/ee%234752-kubernetes-pod-logs-spec-previews/
MVC
Deployment board
- The tooltip shows up when the pod box is on hover.
- Then, the style of pod box will change to:
- Background color -->
#75D09B
- Border color -->
#1AAA55
Pod logs screen
- The
pod name
inbold
style displays after "Pod logs from" in the header. - It has a
Refresh
button in the header, so users can refresh it manually. - Do not need the time span footer for this MVC.
Deployment board | Pod logs screen |
---|---|
MVC.2
- It has the dropdowns in the header, so users can select the containers.
- The width of dropdown is
360px
since the containers sometimes have the long names. - It has timespan of the logs on the bottom of the logs frame. (Optional, nice to have.)
Design spec
https://gitlab-org.gitlab.io/gitlab-design/hosted/hazel/ee%234752-kubernetes-pod-logs-spec-previews/