执行脚本,脚本内部是个简单的批量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
本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828
© CopyRight 2008-2024 All Rights Reserved. Powered By bs178.com 闽ICP备11008920号-3
闽公网安备35020302034844号