Entering the bash/sh shell in an Kubernetes container can look like this:
kubectl exec -it my-pod --container main-app -- /bin/bash
Or.. You can keep it simple with Kubeshell
> kubeshell
Pick your pod:
NAME READY STATUS RESTARTS AGE
wordpress-769bfc894d-qc4z2 1/1 Running 0 6d1h
=> app1377-66655bf4b5-mhldt 1/1 Running 0 6h12m
application1-6d466d7b-cm7r4 1/1 Running 0 6h7m
application2-57c6c89c58-jhbv6 1/1 Running 0 4h12m
exit
Press enter and you’re [hacker voice] in.
GITHub.com/roubles is the author of kubeshell
Easily install with pip:
pip install kubeshell
Hack away! ?