How do I increase log verbosity in Docker for Windows Kubernetes API server?

12/12/2019

When running Docker for Windows, the level of detail in the logs for kube-apiserver is relatively low. Since the k8s node is hosted in a VM it is not obvious where to make changes to the default configuration.

-- Derek Adams
kube-apiserver
kubernetes
logging

1 Answer

12/12/2019

First, log in to the VM using the technique in this article. Once logged in to a Unix shell, execute:

cd /var/lib/kubeadm/manifests

.. then edit the kube-apiserver.yaml using an editor such as:

vi kube-apiserver.yaml

Add a new line, --v=4 in the spec section that determines the command:

spec:                                                                                                                                                       
  containers:                                                                                                                                               
  - command:                                                                                                                                                  
  - kube-apiserver                                                                                                                                          
  - --v=4     

Save the updates, then kill the kube-apiserver pod so that it restarts with the new configuration.

-- Derek Adams
Source: StackOverflow