kubectl logs
does not take into account container log rotation (kubelet
config containerLogMaxSize
and containerLogMaxFiles
). You can still find the latest rotated logs in /var/log/pods/<namespace>_<pod-name>_<pod-uid>/
though.
Don’t assume --since=0s
will have all logs since the container started because it won't look into previous log files. Don't assume a long-running --follow
will always give you latest logs, because it will not switch over to the new log after current is rotated.