kubernetes: ssh_into_kubelet.sh for Linux
Only with networking in bridge (or probably tap) modes, not user mode.
-#!/bin/bash -eux
-ssh="docker run --rm -ti \
- -v $HOME/.ssh/:/root/.ssh \
- ijc25/alpine-ssh \
- -o LogLevel=FATAL \
+#!/bin/bash -eu
+
+sshopts="-o LogLevel=FATAL \
-o StrictHostKeyChecking=no \
-o UserKnownHostsFile=/dev/null \
-o IdentitiesOnly=yes"
-$ssh -t root@"$1" ctr exec --tty --exec-id ssh kubelet ash -l
+
+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 exec --tty --exec-id ssh kubelet ash -l
