How do I ssh to nodes in ACS Kubernetes cluster?
You can use one of the k8s masters as a "bastion host" and avoid copying the keys over. Eg:
# In ~/.ssh/configHost agent1_private_ip agent2_private_ip .... IdentityFile ~/.ssh/<your_k8s_cluster_key> ProxyCommand ssh user@master_public_ip -W %h:%p
Now just ssh user@agent1_private_ip
See more here: http://blog.scottlowe.org/2015/11/21/using-ssh-bastion-host/
PS: Here's a quickie to retrieve your agent private ips, in /etc/hosts
format:
kubectl get nodes -o json | jq -r '.items[].status.addresses[].address' | paste - -
You could copy the private key to your master VM. Then you could use ssh -i <path>/id_rsa user@<agent private IP>
to k8s agent VM.
Note: agent's user name and private key is same with master VM.
Microsoft has released official docs at https://docs.microsoft.com/en-us/azure/aks/ssh. The idea is to SSH into an interactive POD session and use that as jump host to the agent node.