I have created an ACS Kubernetes cluster following the instructions here: https://learn.microsoft.com/en-us/azure/container-service/container-service-kubernetes-walkthrough .
I see that master node has a public IP and I can ssh into the master node using azureuser
. But regular nodes has no public IP and I don't see how I can ssh into regular nodes from master node.
How do I SSH into the regular nodes?
You can use one of the k8s masters as a "bastion host" and avoid copying the keys over. Eg:
# In ~/.ssh/config
Host 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 - -
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With