Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1.1K
Visualizações
Understanding ``stdin: true tty: true`` on a kubernetes container?

I have been readying here and there online but the answer does not come thoroughly explained. I hope this question here if answered, can provide an updated and thorough explanation of the matter.

Why would someone define a container with the following parameters:

stdin: true
tty: true

Also if

`docker run -it`

bind the executed container process to the calling client stdin and tty, what would setting those flag on a container bind its executed process it to ?

I could only envision one scenario, which is, if the command is let say bash, then you can attach to it (i.e. that bash running instance) later after the container is running.

But again one could just run docker run it when necessary. I mean one launch a new bash and do whatever needs to be done. No need to attach to a running one

So the first part of the question is:

a) What is happening under the hood ?

b) Why and when to use it, what difference does it make and what is the added value ?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

AFAIK, setting stdin: true in container spec will simply keep container process stdin open waiting for somebody to attach to it with kubectl attach.

As for tty: true - this simply tells Kubernetes that stdin should be also a terminal. Some applications may change their behavior based on the fact that stdin is a terminal, e.g. add some interactivity, command completion, colored output and so on. But in most cases you generally don't need it.

Btw kubectl exec -it POD bash also contains flags -it but in this case this really needed because you're spawning shell process in container's namespace which expects both stdin and terminal from user.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda