The existing answers are great, just wanted to contribute a really convenient command that lists all pods and containers, so you can choose one to plug into the kubectl exec command.
kubectl get pods -o=custom-columns=POD:.metadata.name,CONTAINERS:.spec.containers[*].name
Gives output like this
POD CONTAINERS
pod-1 service-1,service-2
pod-2 service-1,service-2
pod-3 service-3
pod-4 service-3
Then ssh into any of those containers by just plugging in the names
kubectl exec -it POD -c CONTAINER /bin/sh
e.g. service-2 in pod-2
kubectl exec -it pod-2 -c service-2 /bin/sh
NOTE add -n namespace to any of the above commands to specify a namespace if necessary.