Technical questionAccepted answer
How to login/enter in kubernetes pod
solveit
May 15
0 views1
I have kubernetes pods running as shown in command "kubectl get all -A" :
and same pods are shown in command "kubectl get pod -A" :
I want to enter/login to any of these pod (all are in Running state). How can I do that please let me know the command?
1 answer
Accepted answer · original discussion
Jonas
PermalinkMay 15
Kubernetes Pods are not Virtual Machines, so not something you typically can "log in" to.
But you might be able to execute a command in a container. e.g. with:
kubectl exec <pod-name> -- <command>
Note that your container need to contain the binary for <command>, otherwise this will fail.
See also Getting a shell to a container.
1 question comment
Use comments to ask for clarification. Post a solution as an answer.
Apurva SinghPermalink
Dec 23
you cannot login to a pod. it is not a process. it is a kind of 'environment'. it doesn't have port numbers. only IP. but as mentioned by others, you can exec binaries present on the node, which run as a container.