How can I know entrypoint or cmd to enter inside a kubernetes pod using kubectl?

5/17/2018

I am learning kubernetes right now.I want to enter a pod which is in remote cluster . But, I don't know it's entrypoint. I can't find it using $kubectl describe pod podname.

-- Arun
docker
kubernetes

1 Answer

5/17/2018

If you want to access the shell in a Container(POD), You can use the following command.

kubectl exec POD -c CONTAINER -- COMMAND [args...]

For example, IF the Pod has bash shell, you can access it with the following command.

kubectl exec -it shell-demo -- /bin/bash 

You will be able to access the shell

root@shell-demo:/# ls /

Here is the reference get-shell-running-container

-- Suresh Vishnoi
Source: StackOverflow