dssh icon indicating copy to clipboard operation
dssh copied to clipboard

Add usage examples

Open displague opened this issue 5 years ago • 0 comments

The README could use some examples. I've included a few that I found useful.

Here's an example of installing dssh without git, using keys that are already associated with your Github profile:

# GHUSER is your github username
$ curl -so- https://github.com/GHUSER.keys | kubectl create configmap root-ssh-pubkeys -n kube-system --from-file /dev/stdin
configmap/root-ssh-pubkeys created

$ kubectl apply -f https://raw.githubusercontent.com/asauber/dssh/master/daemonset.yaml
daemonset.apps/root-ssh-manager created

$ ssh [email protected]
Linux lke123-123-123b31337123 5.7.0-1-cloud-amd64 #1 SMP Debian 5.7.6-1 (2020-06-24) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@lke123-123-123b31337123:~#

This could be handy when wanting to run the same command on all nodes:

$ for ip in $(kubectl get nodes -o jsonpath='{ $.items[*].status.addresses[?(@.type=="ExternalIP")].address }'); do \
 ssh root@$ip hostname; done

displague avatar Jul 30 '20 04:07 displague