Skip to content

Instantly share code, notes, and snippets.

@PatrickLang
Last active April 10, 2019 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PatrickLang/10bd2d4f89ff31e7db130db45e480385 to your computer and use it in GitHub Desktop.
Save PatrickLang/10bd2d4f89ff31e7db130db45e480385 to your computer and use it in GitHub Desktop.
Making jumpbox to AKS
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment