加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

containers – kubectl attach:无法使用TTY – 容器es-node没有

发布时间:2020-12-13 18:30:19 所属栏目:Linux 来源:网络整理
导读:我试图附加到Kubernetes中的正在运行的容器,但是我收到下面的错误消息. kubectl attach -it es-client-2756725635-4rk43 -c es-nodeUnable to use a TTY - container es-node did not allocate oneIf you don't see a command prompt,try pressing enter. 如
我试图附加到Kubernetes中的正在运行的容器,但是我收到下面的错误消息.
>kubectl attach -it es-client-2756725635-4rk43 -c es-node
Unable to use a TTY - container es-node did not allocate one
If you don't see a command prompt,try pressing enter.

如何在容器yaml中启用TTY?

解决方法

为了在连接时有适当的TTY和stdin:
kubectl attach -it POD -c CONTAINER

必须使用tty:true和stdin:true配置容器.
默认情况下,这两个值均为false:https://kubernetes.io/docs/api-reference/v1.5/#container-v1

示例Pod:

spec:
      containers:
      - name: web
        image: web:latest
        tty: true
        stdin: true

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读