kubectl run jumpbox --image=debian --port=22 --command "/bin/bash" -- "-c" "while true; do sleep 30; done;"
If it doesn't start, kubectl edit deploy jumpbox
and add this
nodeSelector:
"beta.kubernetes.io/os": linux
kubectl get pod
to find the name kubectl exec -it <podname> bash
to enter it
apt update
apt install ssh vim
mkdir ~/.ssh
vim authorized_keys
# paste in your public key
Now get it a public IP
kubectl expose deploy jumpbox --port=22 --name=jumpbox-ssh --type=LoadBalancer
kubectl get svc
- look for the EXTERNAL-IP. It will be <pending>
at first.
At this point, I can't connect to the pod at the external IP, port 22. TCP connection hangs