gpt4 book ai didi

shell - kubectl exec到pod中,如果通过自动化运行,则每次都无法使用TTY错误

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

我有一个简单的自动化程序可以执行到kubernetes容器中,但是它总是导致以下错误:-

kubectl exec -it my-pod -c my-contaner -n my-namespace /bin/bash
Unable to use a TTY - input is not a terminal or the right kind of file


我正在尝试使用jenkins运行一个简单的shell脚本以执行到pod中并在根目录中执行ls -las,但不允许自动执行到pod中。如果我在linux服务器终端上手动进行操作,同样的事情也可以正常工作。
有人可以帮助解决此问题

最佳答案

Jenkins 构建期间创建容器时,我遇到了相同的错误:

$ oc run netshoot-pod --attach=true --restart=Never --rm -i --tty --image nicolaka/netshoot -- curl $IP

Unable to use a TTY - input is not a terminal or the right kind of file
If you don't see a command prompt, try pressing enter.
Error attaching, falling back to logs

删除 --tty / -t标志已对其进行了修复。

关于shell - kubectl exec到pod中,如果通过自动化运行,则每次都无法使用TTY错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59002583/

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