kubernetes can't tail log with the number of desired lines

3/11/2016

I looking for the way to tail log with kubernetes

Why the test

kubectl log --tail=-30 mypod mycontainer | wc -l
190547

Not giving 30 ?

-- Ali SAID OMAR
google-cloud-platform
kubernetes

1 Answer

3/11/2016

You're passing it -30, which isn't a valid number of log lines, so it's returning all the lines. Pass it a positive number, i.e. 30, and it should do what you want.

-- Alex Robinson
Source: StackOverflow