Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!