While troubleshooting Kubernetes-related issues it is useful to know how to increase the verbosity level of the main debugging tool – the kubectl
command.
The verbosity of the kubectl
command is controlled by the -v
or --v
flags followed by an integer from 0 to 9 that represents the log level.
In this note i will show how to increase the verbosity level of the kubectl
command, that is extremely useful for debugging of the Kubernetes-related issues.
Cool Tip: Get Pod’s logs using the kubectl
command! Read more →
Kubectl: Debug – Verbose Output
Use the following syntax of the kubectl
command to set the verbosity level from 0 to 9:
$ kubectl <command> --v=<verbosity_level>
Examples:
# Minimum verbosity $ kubectl cluster-info --v=0 # Debug level verbosity $ kubectl cluster-info --v=4 # Maximum verbosity $ kubectl cluster-info --v=9
Cool Tip: Run the kubectl
command in a dry-run mode! Read more →
All the available verbosity levels of the kubectl
command:
Verbosity | Description |
---|---|
--v=0 |
Generally useful for this to always be visible to a cluster operator. |
--v=1 |
A reasonable default log level if you don’t want verbosity. |
--v=2 |
Useful steady state information about the service and important log messages that may correlate to significant changes in the system. This is the recommended default log level for most systems. |
--v=3 |
Extended information about changes. |
--v=4 |
Debug level verbosity. |
--v=5 |
Trace level verbosity. |
--v=6 |
Display requested resources. |
--v=7 |
Display HTTP request headers. |
--v=8 |
Display HTTP request contents. |
--v=9 |
Display HTTP request contents without truncation of contents. |
Cool Tip: Get events sorted by time using the kubectl
command! Read more →