This plugin will provide an easy way to SSH into Kubernetes Worker nodes running and have joined the Amazon EKS cluster using kubectl
.
mkdir -p ~/.kube/plugins
git clone https://github.com/nithu0115/kubectl-ssh-plugin-eks.git
You should have a ssh key pair in your ~/.ssh/
directory and you will be able to use
this plugin to ssh
into the Worker nodes which are part of the Cluster.
kubectl plugin ssh <worker node name>
To pass an ssh key, please use -i
flag that will append the proper identity file.
kubectl plugin ssh <worker node name> -i ~/.ssh/Nithish.pem
To see the full usage of the SSH plugin, please use --help
flag to print the following.
Usage:
kubectl plugin ssh <worker node name> [options]
Opens up an SSH connection to the node that you pass into the command, allowing you to work faster without writing out the full ssh command.
Options:
-p, --cloud-provider='aws': Use this flag if you are using AWS EKS
-i, --identity-file='~/.ssh/id_rsa': Identity file to use to ssh into the instance.
-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
-u, --ssh-user='ec2-user': Login user to be used for the ssh command.
Use "kubectl options" to list global command-line options (applies to all commands).