5

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

Rico
  • 58,485
  • 12
  • 111
  • 141
Draqun
  • 344
  • 2
  • 14
  • 1
    just set the env DEBUG to "", detail see here: https://stackoverflow.com/questions/43144822/disabling-network-logs-on-kubernetes-when-running-kubectl-exec – user19485118 Jul 05 '22 at 07:58
  • @user19485118 You're right. The problem occurs because of mess in my system, and DEBUG flag. – Draqun Sep 27 '22 at 16:45

1 Answers1

0

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 ...
Rico
  • 58,485
  • 12
  • 111
  • 141
  • I've kubernates installed with Docker. I also updated the kubernetes using official package. My minicube was installed via choco. So all elements should work without any weird complications. I'll check your proposition – Draqun Jul 01 '20 at 10:46
  • 1
    Sadly flag -v=0 (or other number too) does not make a change – Draqun Jul 01 '20 at 10:49
  • Did you get it figured out? – Rico Aug 11 '20 at 15:23
  • Are you running on Windows? On a command prompt? Also, where did you download kubectl from? – Rico Aug 11 '20 at 18:51
  • PLatform is Windows, Kubernetes comes with docker. I tried also kubernetes from official kubernetes page but it does not change anything. – Draqun Aug 12 '20 at 12:19
  • What about kubectl? where did you download it from? Did you build it from source? – Rico Aug 12 '20 at 15:21
  • No I didn't. I had no time to do it. I expected out of box solution, now I do not have time for spending it for kubernetes. – Draqun Aug 24 '20 at 17:07
  • If it's out of the box, it should be fine. I was wondering where you got, maybe it was prebuilt with something specific. – Rico Aug 24 '20 at 17:45
  • It has to be some shell environment variable forcing it to output verbose. – Rico Aug 24 '20 at 17:46