What is the recommended --v log level for k8s control plane components in production cluster?

3/28/2020

I'm trying to find a reasonable log level in which control plane component (e.g. kubelet) would print enough information helping debug when a problem happens, and also the log file size wouldn't be too large, causing any potential disk io problem.

K8s log level flag --v is not well documented, the most helpful doc I can find is this , it is about kubectl's --v falg, so I'm not sure if it's correct with kubelet, or apiserver, the description of log level 5 is also missing.

Is there any other docs? Or is there any best practice of --v setting?

-- Jin Mengfei
kubernetes

1 Answer

3/28/2020

kubectl --v=5 - Trace level verbosity is documented here

On a production cluster i will recommend keeping default log level, and only change to more verbose logs when needed to debug cluster level issues (and return the log verbosity back to default after any such troubleshooting is done)

to change kublet verbosity you can append /var/lib/kubelet/kubeadm-flags.env file with --v=5 flag and restart kublet to read to required verbosity .

-- DT.
Source: StackOverflow