How do I ssh into LKE nodes?

I would like to ssh into the LKE nodes of my LKE cluster. It seems that there is no way to add my ssh public keys to these LKE nodes from the UI or cli. Is there a simple way to do this when I create a LKE cluster?

3 Replies

While there isn't a simple way to add your SSH keys to the nodes in an LKE Cluster on creation, one of our LKE developers created dssh which should be able to help with this.

dssh is a daemonset that you can deploy and every 60 seconds it will apply your SSH keys to each node in the cluster. This process ensures that even if a node is deleted and recreated your SSH keys will still be applied so you can access it via SSH.

Install node-shell:
https://github.com/kvaps/kubectl-node-shell

Then:
kubectl node-shell <node-name></node-name>

Further to @fishstick's recommendation, I found that node-shell v1.5.1 worked for me, while more recent versions didn't.

To install that version:

sudo curl -o /usr/local/bin/kubectl-node_shell https://raw.githubusercontent.com/kvaps/kubectl-node-shell/v1.5.1/kubectl-node_shell
sudo chmod +x /usr/local/bin/kubectl-node_shell

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct