According to this documentation there doesn't seem to be a way you can do this. There is a verbosity flag -v
but that is for the level of verbosity in kubectl
itself, not in the logs it is getting for the pods/containers
.
Then you also have the --stderrthreshold <SEVERITY>
option to kubectl
as provided in this doc, but I suspect that is the same thing.
Perhaps a better way of handling this would be to set what is called a logging architecture
for your cluster where you can control which logs the pod actually generates. (read more here) In that way, fetching them from kubectl
will be probably more desirable.
We almost always use a 3rd party centralized logging solution (like fleuntd), outside of k8s for this specific reason. And we simply inject a logging sidecar container to your pods which continuously dumps the logs to this central component. This is a very common design pattern.