Kubernetes exec return the mess from container

Viewed 302

I'm trying to learn Kubernetes, and always when I run kubectl exec there is a total mess in console:

$ kubectl.exe exec pod-httpd -c cntr-httpd -- ls -l
I0630 16:45:11.161801    1136 log.go:172] (0xc0000e82c0) (0xc000280d20) Create stream
I0630 16:45:11.170797    1136 log.go:172] (0xc0000e82c0) (0xc000280d20) Stream added, broadcasting: 1
I0630 16:45:11.175797    1136 log.go:172] (0xc0000e82c0) Reply frame received for 1
I0630 16:45:11.175797    1136 log.go:172] (0xc0000e82c0) (0xc000415680) Create stream
I0630 16:45:11.176798    1136 log.go:172] (0xc0000e82c0) (0xc000415680) Stream added, broadcasting: 3
I0630 16:45:11.177804    1136 log.go:172] (0xc0000e82c0) Reply frame received for 3
I0630 16:45:11.177804    1136 log.go:172] (0xc0000e82c0) (0xc0002da0a0) Create stream
I0630 16:45:11.177804    1136 log.go:172] (0xc0000e82c0) (0xc0002da0a0) Stream added, broadcasting: 5
I0630 16:45:11.179799    1136 log.go:172] (0xc0000e82c0) Reply frame received for 5
I0630 16:45:11.226800    1136 log.go:172] (0xc0000e82c0) Data frame received for 3
I0630 16:45:11.226800    1136 log.go:172] (0xc000415680) (3) Data frame handling
I0630 16:45:11.226800    1136 log.go:172] (0xc000415680) (3) Data frame sent
total 40
drwxr-xr-x 2 root root 4096 Jun  9 07:02 bin
drwxr-xr-x 2 root root 4096 Jun  9 07:02 build
drwxr-xr-x 2 root root 4096 Jun  9 07:02 cgi-bin
drwxr-xr-x 4 root root 4096 Jun  9 07:02 conf
drwxr-xr-x 3 root root 4096 Jun  9 07:02 error
drwxr-xr-x 2 root root 4096 Jun  9 07:02 htdocs
drwxr-xr-x 3 root root 4096 Jun  9 07:02 icons
drwxr-xr-x 2 root root 4096 Jun  9 07:02 include
drwxr-xr-x 1 root root 4096 Jun 30 14:35 logs
drwxr-xr-x 2 root root 4096 Jun  9 07:02 modules
I0630 16:45:11.367590    1136 log.go:172] (0xc0000e82c0) Data frame received for 1
I0630 16:45:11.367590    1136 log.go:172] (0xc000280d20) (1) Data frame handling
I0630 16:45:11.367590    1136 log.go:172] (0xc000280d20) (1) Data frame sent
I0630 16:45:11.368592    1136 log.go:172] (0xc0000e82c0) (0xc000415680) Stream removed, broadcasting: 3
I0630 16:45:11.368592    1136 log.go:172] (0xc0000e82c0) (0xc000280d20) Stream removed, broadcasting: 1
I0630 16:45:11.369594    1136 log.go:172] (0xc0000e82c0) (0xc0002da0a0) Stream removed, broadcasting: 5
I0630 16:45:11.369594    1136 log.go:172] (0xc0000e82c0) Go away received
I0630 16:45:11.369594    1136 log.go:172] (0xc0000e82c0) (0xc000280d20) Stream removed, broadcasting: 1
I0630 16:45:11.370592    1136 log.go:172] (0xc0000e82c0) (0xc000415680) Stream removed, broadcasting: 3
I0630 16:45:11.370592    1136 log.go:172] (0xc0000e82c0) (0xc0002da0a0) Stream removed, broadcasting: 5

If I try run shell there is a lot of debugging information, which does not allow me to work comfortably

I run it on Windows.

Kubernetes version

$ kubectl.exe version --short
Client Version: v1.18.0
Server Version: v1.18.3

Any help to disabling this debug message will be appreciated.

Best regards, Draqun

1 Answers

It looks like the default verbosity is set to something higher than -v=0. Also, afaik there is no option to read the verbosity from a config file as of this writing. I wonder where you downloaded your kubectl.exe file from.

You can run kubectl options to set the default global options configured.

$ kubectl.exe options
The following options can be passed to any command:
...
  -v, --v=0: number for the log level verbosity
...

The short term fix is just to force that option in the command line:

$ kubectl.exe -v=0 ...
Related