I have a Kubernetes pod running on Google Container Engine. It has been running for several days, writing to the log, without any restarts.
Why is the command kubectl logs
only showing log rows from today?
Where does this limitation come from and is it based on time or number of log rows?
Logrotate is enabled by default on container engine VMs. You should be able to check conf at below location for docker container logs.
cat /etc/logrotate.d/docker-containers
So when you run kubectl logs
, it streams you from current log file. Past logs are already gzipped and also only N compressed files are available as per logrotate configuration.
You can check all containers log files at location /var/log/containers
also sym linked to /var/lib/docker/containers/$containerId/
You may also want to refer to documentation http://kubernetes.io/docs/user-guide/kubectl/kubectl_logs/ and see if additional options can come to rescue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With