Skip to content

Commit d46b1b3

Browse files
author
Yoichi Kawasaki
committed
fixup doc bug
1 parent c9c3140 commit d46b1b3

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

README.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# kubectl-plugin-ssh-jumphost
1+
# kubectl-plugin-ssh-jump
22

33
A kubectl plugin to SSH into Kubernetes nodes using a SSH jump host Pod
44

@@ -11,32 +11,34 @@ Here is an scenario where you want to connect to Kubernetes node, but you have t
1111
> [NOTE]
1212
> - Kubectl versions >= `1.12.0` (Preferred)
1313
> - As of Kubernetes 1.12, kubectl now allows adding external executables as subcommands. For more detail, see [Extend kubectl with plugins](https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/)
14-
> - You can run the pluin with `kubectl ssh ...`
14+
> - You can run the pluin with `kubectl ssh-jump ...`
1515
> - Kubectl versions < `1.12.0`
16-
> - You still can run the plugin directly with `kubectl-ssh ...`
16+
> - You still can run the plugin directly with `kubectl-ssh-jump ...`
1717
1818

1919
## Installation
2020

21+
### Manual Installation
22+
2123
Install the plugin by copying the script in the $PATH of your shell.
2224

2325
```sh
2426
# Get source
25-
$ git clone https://github.com/yokawasa/kubectl-plugin-ssh-jumphost.git
26-
$ cd kubectl-plugin-ssh-jumphost
27-
$ chmod +x kubectl-ssh
28-
# Add kubeclt-ssh to the install path.
29-
$ sudo cp -p kubectl-ssh /usr/local/bin
27+
$ git clone https://github.com/yokawasa/kubectl-plugin-ssh-jump.git
28+
$ cd kubectl-plugin-ssh-jump
29+
$ chmod +x kubectl-ssh-jump
30+
# Add kubeclt-ssh-jump to the install path.
31+
$ sudo cp -p kubectl-ssh-jump /usr/local/bin
3032
```
3133

3234
Once in the $PATH, run:
3335
```sh
3436
$ kubectl plugin list
3537

3638
The following kubectl-compatible plugins are available:
37-
/usr/local/bin/kubectl-ssh
39+
/usr/local/bin/kubectl-ssh-jump
3840

39-
$ kubectl ssh
41+
$ kubectl ssh-jump
4042
```
4143

4244
## How to use
@@ -45,7 +47,7 @@ $ kubectl ssh
4547

4648
```TXT
4749
Usage:
48-
kubectl ssh <dest_node> [options]
50+
kubectl ssh-jump <dest_node> [options]
4951
5052
Options:
5153
<dest_node> Destination node IP
@@ -81,13 +83,13 @@ In addtion, add `--skip-agent` option if you want to skip automatic starting `ss
8183

8284
### Examples
8385

84-
Show all node list. Simply executing `kubectl ssh` gives you the list of destination nodes as well as command usage
86+
Show all node list. Simply executing `kubectl ssh-jump` gives you the list of destination nodes as well as command usage
8587

8688
```sh
87-
$ kubectl ssh
89+
$ kubectl ssh-jump
8890

8991
Usage:
90-
kubectl ssh <dest_node> [options]
92+
kubectl ssh-jump <dest_node> [options]
9193

9294
Options:
9395
<dest_node> Destination node IP
@@ -119,19 +121,19 @@ Then, SSH into a node `aks-nodepool1-18558189-0` with options like:
119121
- identity:`~/.ssh/id_rsa_k8s`
120122
- pubkey:`~/.ssh/id_rsa_k8s.pub`)
121123
```sh
122-
$ kubectl ssh aks-nodepool1-18558189-0 \
124+
$ kubectl ssh-jump aks-nodepool1-18558189-0 \
123125
-u azureuser -i ~/.ssh/id_rsa_k8s -p ~/.ssh/id_rsa_k8s.pub
124126
```
125127
126128
As explained in usage secion, `username`, `identity`, `pubkey` options are cached, therefore you can omit these options afterward.
127129
128130
```sh
129-
$ kubectl ssh aks-nodepool1-18558189-0
131+
$ kubectl ssh-jump aks-nodepool1-18558189-0
130132
```
131133
132134
You can pass the commands to run in the destination node like this (Suppose that `username`, `identity`, `pubkey` options are cached):
133135
```sh
134-
echo "uname -a" | kubectl ssh aks-nodepool1-18558189-0
136+
echo "uname -a" | kubectl ssh-jump aks-nodepool1-18558189-0
135137

136138
(Output)
137139
Linux aks-nodepool1-18558189-0 4.15.0-1035-azure #36~16.04.1-Ubuntu SMP Fri Nov 30 15:25:49 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
@@ -140,14 +142,14 @@ Linux aks-nodepool1-18558189-0 4.15.0-1035-azure #36~16.04.1-Ubuntu SMP Fri Nov
140142
141143
You can clean up sshjump pod at the end of the command with `--cleanup-jump` option, otherwise, the sshjump pod stay running by default.
142144
```sh
143-
$ kubectl ssh aks-nodepool1-18558189-0 \
145+
$ kubectl ssh-jump aks-nodepool1-18558189-0 \
144146
-u azureuser -i ~/.ssh/id_rsa_k8s -p ~/.ssh/id_rsa_k8s.pub \
145147
--cleanup-jump
146148
```
147149
148150
You can clean up ssh-agent at the end of the command with `--cleanup-agent` option, otherwise, the ssh-agent process stay running once it's started.
149151
```sh
150-
$ kubectl ssh aks-nodepool1-18558189-0 \
152+
$ kubectl ssh-jump aks-nodepool1-18558189-0 \
151153
-u azureuser -i ~/.ssh/id_rsa_k8s -p ~/.ssh/id_rsa_k8s.pub \
152154
--cleanup-agent
153155
```
@@ -159,7 +161,7 @@ $ eval `ssh-agent`
159161
# Add an arbitrary private key, give the path of the key file as an argument to ssh-add
160162
$ ssh-add ~/.ssh/id_rsa_k8s
161163
# Then, run the plugin with --skip-agent
162-
$ kubectl ssh aks-nodepool1-18558189-0 \
164+
$ kubectl ssh-jump aks-nodepool1-18558189-0 \
163165
-u azureuser -i ~/.ssh/id_rsa_k8s -p ~/.ssh/id_rsa_k8s.pub \
164166
--skip-agent
165167
@@ -174,4 +176,4 @@ $ ssh-agent -k
174176
175177
## Contributing
176178
177-
Bug reports and pull requests are welcome on GitHub at https://github.com/yokawasa/kubectl-plugin-ssh-jumphost
179+
Bug reports and pull requests are welcome on GitHub at https://github.com/yokawasa/kubectl-plugin-ssh-jump

0 commit comments

Comments
 (0)