kubernetes: ssh_into_kubelet.sh for Linux

Only with networking in bridge (or probably tap) modes, not user mode.

Signed-off-by: Ian Campbell <ijc@docker.com>
This commit is contained in:
Ian Campbell 2017-07-25 16:05:23 +01:00
parent 9f04b403e4
commit 7d7001c573

View File

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