coderanger / kitchen-kubernetes

A Test Kitchen driver for testing on top of a Kubernetes cluster.
Apache License 2.0
29 stars 10 forks source link

SSH agent forwarding #5

Closed HarryYC closed 6 years ago

HarryYC commented 6 years ago

Some of my cookbooks need to forward ssh agent in order to be converged. But it looks like kubernetes doesn't support ssh agent forwarding. I know docker can do this using the command: docker run --volume $SSH_AUTH_SOCK:/ssh-agent --env SSH_AUTH_SOCK=/ssh-agent ubuntu ssh-add -l Is there a way to forward ssh agent to a running(or create a new one) pod?

coderanger commented 6 years ago

This is unfortunately not possible in almost all cases as you can't share domain sockets across servers. This would only work with the equivalent of minikube --vm-driver=none, i.e. when TK is running on the single Kubernetes server. And in that situation, kitchen-docker or kitchen-dokken is probably better anyway since the whole reason I wrote this was to take advantage of existing, powerful Kubernetes clusters.