A utility for generating ssh config files for every node of a cluster.
-
Set
KUBECONFIG
so that you get the desired nodes when you run$ kubectl get nodes
. -
Add
Include config.d/*
to the top of your~/.ssh/config
. -
$ mkdir ~/.ssh/config.d
-
$ kssh --bastion bastionIpAddress > ~/.ssh/config.d/clustername
-
$ chmod 600 ~/.ssh/config.d/*
To get the list of host names to connect to:
$ kssh --nodes
Then try sshing into the node:
$ ssh ip-10-16-111-77.us-west-1.compute.internal
Container Linux by CoreOS stable (1520.9.0)
Update Strategy: No Reboots
core@ip-10-16-111-77 ~ $
kssh
can output valid cssh
config files for easy cluster ssh access.
cssh
is in yum/dnf
and apt
repos as clusterssh
.
$ cssh -u # set up cssh
$ kssh -cssh clustername > ~/.clusterssh/clustername
$ vi ~/.clusterssh/config # edit extra_cluster_file to add ~/.clusterssh/clustername
An example extra_cluster_file
line:
extra_cluster_file=~/.clusterssh/prod-west,~/.clusterssh/prod-east