Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. ```bash
  2. kubectl run jumpbox --image=debian --port=22 --command "/bin/bash" -- "-c" "while true; do sleep 30; done;"
  3. ```
  4.  
  5. If it doesn't start, `kubectl edit deploy jumpbox` and add this
  6. ```yaml
  7. nodeSelector:
  8. "beta.kubernetes.io/os": linux
  9. ```
  10.  
  11. `kubectl get pod` to find the name `kubectl exec -it <podname> bash` to enter it
  12.  
  13. ```bash
  14. apt update
  15. apt install ssh vim
  16. mkdir ~/.ssh
  17. vim authorized_keys
  18. # paste in your public key
  19. ```
  20.  
  21. Now get it a public IP
  22.  
  23. `kubectl expose deploy jumpbox --port=22 --name=jumpbox-ssh --type=LoadBalancer`
  24.  
  25. `kubectl get svc` - look for the EXTERNAL-IP. It will be `<pending>` at first.
  26.  
  27. > At this point, I can't connect to the pod at the external IP, port 22. TCP connection hangs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement