Exploring kubectl HTTP request verbose option and custom kube-config based on kubernetes RBAC

Kubectl checking HTTP request using verbose option

Balkrishna Pandey
Goglides

--

We can use -v or — v flags followed by an integer to check how kubectl is sending HTTP request. For integer value you can use from 0–8, but only 6–8 value is used for HTTP request.

Verbosity level 6

This level will display all requested resources with HTTP response code and time take to complete each request. For example:

18kubectl get pods -v=6

I0927 16:59:16.117531 85026 loader.go:357] Config loaded from file /Users/username/.kube/yala
I0927 16:59:17.090324 85026 round_trippers.go:436] GET https://api-k8s/api 200 OK in 971 milliseconds
I0927 16:59:17.262158 85026 round_trippers.go:436] GET https://api-k8s/apis 200 OK in 170 milliseconds
No resources found.

Verbosity level 7

This level will display HTTP request with headers. For example:

18kubectl get pods -v=7

ggg:ghost bkpandey$ 18kubectl get pods -v=7I0927 17:07:33.435101   85152 loader.go:357] Config loaded from file /Users/bkpandey/.kube/yalaI0927 17:07:33.437478   85152 round_trippers.go:414] GET https://api-k8s/apiI0927 17:07:33.437498   85152 round_trippers.go:421] Request Headers:

--

--