Files
linuxkit/projects/kubernetes/ssh_into_kubelet.sh
Ian Campbell c227c31e75 kubernetes: try and make exec-id unique
Hopefully hostname + local pid should be unlikely to clash.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-09-27 17:01:07 +01:00

19 lines
374 B
Bash
Executable File

#!/bin/bash -eu
sshopts="-o LogLevel=FATAL \
-o StrictHostKeyChecking=no \
-o UserKnownHostsFile=/dev/null \
-o IdentitiesOnly=yes"
case $(uname -s) in
Linux)
ssh=ssh
;;
*)
ssh="docker run --rm -ti \
-v $HOME/.ssh/:/root/.ssh \
ijc25/alpine-ssh"
;;
esac
$ssh $sshopts -t root@"$1" ctr tasks exec --tty --exec-id ssh-$(hostname)-$$ kubelet ash -l