Issue using readNamespacedPodLog

3/27/2019

I am trying to ascertain if there are log files for pods with sizes > 10Mb and reporting on them. When I do readNamespacedPodLog with a limitBytes of 10MB, I get size way less than that sometimes as much as half of that. I understand that the readNamespacedPodLog may return a little < or > the specified limitBytes, but can it be that much of a difference ?

I am using kubernetes-client jar 3.0.0.. I also tried switching to 4.0.0.

I am calling as below:

apiInstance.readNamespacedPodLog(podName,namespace,null,
    false,10485760,"false",null,null,false)

For example, on a pod that I know has a log file > 11 Mb I consistently get about 6MB being returned.

If I switch to 5Mb, then it exactly returns 5Mb when the file has > 5Mb.

Is this how it should behave? Should I limit to 5 and do a continuous couple of 5 Mb reads to ascertain if the file has 10 Mb?

-- Sreeni
java
kubernetes

1 Answer

4/19/2019

There was an issue with one specific pod. Issue has gone after pod restart. For all other pods log sizes are correct.

-- VKR
Source: StackOverflow