kubectl exec失败,并显示错误“无法使用TTY-输入的不是终端或正确的文件类型". [英] kubectl exec fails with the error "Unable to use a TTY - input is not a terminal or the right kind of file"

查看:1722
本文介绍了kubectl exec失败,并显示错误“无法使用TTY-输入的不是终端或正确的文件类型".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下命令运行詹金斯管道:

I am running a jenkins pipeline with the following command:

kubectl exec -it kafkacat-5f8fcfcc57-2txhc -- kafkacat -b cord-kafka -C -t BBSim-OLT-0-Events -o s@1585031458

在运行管道的机器的终端上运行良好,但是在实际管道上,我收到以下错误:无法使用TTY-输入的不是终端或正确的文件类型"

which is running fine on the terminal of the machine the pipeline is running on, but on the actual pipeline I get the following error: "Unable to use a TTY - input is not a terminal or the right kind of file"

有关如何解决此问题的任何提示?

Any tips on how to go about resolving this?

推荐答案

标记 kubectl exec一起使用,它将启用TTY交互模式.鉴于您提到的错误,Jenkins似乎没有分配TTY.

When the flags -it are used with kubectl exec, it enables the TTY interactive mode. Given the error that you mentioned, it seems that Jenkins doesn't allocate a TTY.

由于您是在Jenkins作业中运行命令,因此我认为您的命令不一定是交互式的.解决该问题的一种可能的方法是简单地删除-t标志并尝试执行以下命令:

Since you are running the command in a Jenkins job, I would assume that your command is not necessarily interactive. A possible solution for the problem would be to simply remove the -t flag and try to execute the following instead:

kubectl exec -i kafkacat-5f8fcfcc57-2txhc -- kafkacat -b cord-kafka -C -t BBSim-OLT-0-Events -o s@1585031458

这篇关于kubectl exec失败,并显示错误“无法使用TTY-输入的不是终端或正确的文件类型".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆