gpt4 book ai didi

windows - Kubernetes exec 从容器中返回困惑

转载 作者:行者123 更新时间:2023-12-02 12:26:51 24 4
gpt4 key购买 nike

我正在尝试学习 Kubernetes,但当我运行 kubectl exec 时,控制台总是一团糟:

$ 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

如果我尝试运行 shell 会有很多调试信息,这让我无法舒适地工作

我在 Windows 上运行它。

Kubernetes 版本

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

任何有关禁用此调试消息的帮助都将不胜感激。

最好的问候,德拉昆

最佳答案

看起来默认的详细程度设置为高于 -v=0。另外,据我所知,在撰写本文时,没有选项可以从配置文件中读取详细信息。我想知道您从哪里下载了 kubectl.exe 文件。

您可以运行 kubectl options 来设置配置的默认全局选项。

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

短期修复只是在命令行中强制使用该选项:

$ kubectl.exe -v=0 ...

关于windows - Kubernetes exec 从容器中返回困惑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62660240/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com