pai
pai copied to clipboard
k8s dashboard crash caused by large docker log
How to reproduce:
- Step 1. Find a pod in which the docker container has a huge size of log file, say 500 MB.
- Step 2. Go to the k8s dashboard and check the pod's log. Or use the following API call:
http://<k8s-dashboard>/api/v1/pod/<namespace>/<pod>/log
Then the k8s dashboard will crash.
Possible solution:
- Limit the docker log size by adding
--log-opt max-size=50mflag. Ref: https://stackoverflow.com/a/32091923
seems to relate to this issue: https://github.com/kubernetes/dashboard/pull/2007
resolved in 0.4.0 by upgrading k8s dashboard version.