SSH into pod

2,586 views
Skip to first unread message

Eswari

unread,
Aug 11, 2017, 2:11:30 AM8/11/17
to Kubernetes user discussion and Q&A
Hi,

I have exposed my pod externally (public ip).
Tried to ssh to my pod using ssh root@Pod_PublicIP from my local linux box

But I am unable to take ssh.
Is it possible to take ssh to my pod


Warren Strange

unread,
Aug 11, 2017, 2:34:41 PM8/11/17
to Kubernetes user discussion and Q&A

Rather than setting up ssh, it may be easier to use kubectl exec to get a shell inside your pod:

kubectl exec my-pod-xxx -it /bin/sh 

eswar...@gmail.com

unread,
Aug 14, 2017, 2:48:32 AM8/14/17
to Kubernetes user discussion and Q&A
Hi Warren Strange,

Thanks for the reply.

Yes, But we can use this command where we installed kubectl only.
But I need to take ssh from my local linux machine where I doesn't have kubectl.

Is it possible?

Warren Strange

unread,
Aug 14, 2017, 10:17:49 AM8/14/17
to Kubernetes user discussion and Q&A, eswar...@gmail.com

Yes, it is possible, but it is not recommended.  Here is an older article that discusses the issues:



If you *really* need to do this, you must enable sshd in the container, and create a kubernetes service to reach it. You will want to read up on services:

Reply all
Reply to author
Forward
0 new messages