Skip to content

How to ssh into Kubernetes pod

kubectl exec -it <podname> -- sh

To get a list of running pods in the current namespace:

kubectl get pods

To ssh into a specific container:

kubectl exec -it <podName> -c <containerName> -- sh

Chinh Do

I occasionally blog about programming (.NET, Node.js, Java, PowerShell, React, Angular, JavaScript, etc), gadgets, etc. Follow me on Twitter for tips on those same topics. You can also find me on GitHub.

See About for more info.

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top