kubectl附加:无法使用TTY-容器es节点未分配一个 [英] kubectl attach: Unable to use a TTY - container es-node did not allocate one

查看:462
本文介绍了kubectl附加:无法使用TTY-容器es节点未分配一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图附加到Kubernetes中正在运行的容器,但是我收到以下错误消息.

I am trying to attach to a running container in Kubernetes, however I get the error message below.

>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?

How do I enable a TTY in my container yaml?

推荐答案

为了在执行附加操作时具有适当的TTY和stdin:

In order to have proper TTY and stdin when doing attach:

kubectl attach -it POD -c CONTAINER

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

The container must be configured with tty: true and stdin: true. By default both of those values are false: https://kubernetes.io/docs/api-reference/v1.5/#container-v1

示例Pod:

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

这篇关于kubectl附加:无法使用TTY-容器es节点未分配一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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