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

184
Visualizações
Does Kubernetes always give a shell to the running container

I having my Pod manifest as below:

apiVersion: v1
kind: Pod
metadata:
  name: pod-nginx-container
spec:
  containers:
  - name: nginx-alpine-container-1
    image: nginx:alpine
    ports:
      - containerPort: 80

And I can get a shell to the Container running my Nginx using kubectl exec --stdin --tty pod-nginx-container -- /bin/sh

My question is does Kubernetes always give a shell to the running container? I mean suppose I have created my own image of Tomcat webserver, and when I use that image then will I still get the shell to login to the container running Tomcat?

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

0

Kubernetes

Kubernetes schedules Pods to nodes. A Pod consists of one or more containers - that are instantiated from container images.

Container image

A container image contains a command that will run as the main process but it can also contain other binaries and also a full Linux "userland" like e.g. Ubuntu with shell and lots of tools.

Container images can be built from "scratch" without any other software than e.g. your app, but typically contain some more software for your app to be runnable e.g. glibc. See distroless for minimal base images that does not contain a shell.

Conclusion

My question is does Kubernetes always give a shell to the running container? I mean suppose I have created my own image of Tomcat webserver, and when I use that image then will I still get the shell to login to the container running Tomcat?

Your container contain a shell, only if you have built in a shell - most likely by using a base image that contain a shell e.g. alpine or ubuntu.

It depends on what do you do in your Dockerfile before building a container image with docker build

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