From 88474c7831da23dc6f2f0a0842ea3913a540ac32 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Fri, 15 Jul 2022 08:00:35 +0100 Subject: [PATCH] Updated kube-ssh to use alpine Signed-off-by: Marcus Noble --- home/.bin/kube-ssh | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/home/.bin/kube-ssh b/home/.bin/kube-ssh index 6365238..83fcead 100755 --- a/home/.bin/kube-ssh +++ b/home/.bin/kube-ssh @@ -66,29 +66,7 @@ if [[ "$NODE" == "" ]]; then fi fi - NODE_NAME=$(kubectl get node $NODE -o template --template='{{index .metadata.labels "kubernetes.io/hostname"}}') NODE_SELECTOR='"nodeSelector": { "kubernetes.io/hostname": "'${NODE_NAME}'" },' -kubectl run --namespace ${NAMESPACE} $POD --restart=Never -it --rm --image overriden --overrides ' -{ - "spec": { - "hostPID": true, - "hostNetwork": true, - '"${NODE_SELECTOR}"' - "tolerations": [{ - "operator": "Exists" - }], - "containers": [ - { - "name": "kube-ssh", - "image": "averagemarcus/kube-ssh:latest", - "stdin": true, - "tty": true, - "securityContext": { - "privileged": true - } - } - ] - } -}' --attach +kubectl run --namespace ${NAMESPACE} $POD --rm -it --image alpine --privileged --overrides '{"spec":{'"${NODE_SELECTOR}"'"hostPID": true}}' --command nsenter -- --mount=/proc/1/ns/mnt -- /bin/bash