kubectl显示unable to use TTY的问题

错误现象

执行脚本,脚本内部是个简单的批量pod的操作

kubectl -n mytest get pod  | grep nginx | awk '{print "kubectl -n mytest exec -it "$1" -- bash cleanlog.sh"}'|sh 

Unable to use a TTY - input is not a terminal or the right kind of file


查看帮助信息

Options:

-c, --container='': Container name. If omitted, the first container in the pod will be chosen

-f, --filename=[]: to use to exec into the resource

--pod-running-timeout=1m0s: The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one

pod is running

-i, --stdin=false: Pass stdin to the container

-t, --tty=false: Stdin is a TTY ,这里需要创建一个交互TTY终端,可以考虑取掉-t参数

修正解决

kubectl -n mytest get pod  | grep nginx | awk '{print "kubectl -n mytest exec -i "$1" -- bash cleanlog.sh"}'|sh 


展开阅读全文

页面更新:2024-04-30

标签:终端   批量   脚本   现象   错误   参数   操作   简单   信息

1 2 3 4 5

上滑加载更多 ↓
推荐阅读:
友情链接:
更多:

本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828  

© CopyRight 2008-2024 All Rights Reserved. Powered By bs178.com 闽ICP备11008920号-3
闽公网安备35020302034844号

Top