@@ -33,14 +33,14 @@ Here is an scenario where you want to connect to Kubernetes nodes or remote serv
33
33
- [How to use](#how-to-use)
34
34
- [Usage](#usage)
35
35
- [Option parameters Cache](#option-parameters-cache)
36
- - [SSH Agent ( ssh-agent) ](#ssh-agent-ssh-agent)
36
+ - [SSH Agent ssh-agent](#ssh-agent-ssh-agent)
37
37
- [Customize SSH jump pod](#customize-ssh-jump-pod)
38
38
- [Examples](#examples)
39
39
- [CASE 1: SSH into Kubernetes nodes via SSH jump Pod](#case-1-ssh-into-kubernetes-nodes-via-ssh-jump-pod)
40
- - [1 -1 - You have private & public SSH key on your side](#1 -1---you-have-private--public-ssh-key-on-your-side)
41
- - [1 -2 - You have .pem file but you don't have public key on your side](#1 -2---you-have-pem-file-but-you-dont-have-public-key-on-your-side)
40
+ - [-1 - You have private & public SSH key on your side](#-1---you-have-private--public-ssh-key-on-your-side)
41
+ - [-2 - You have .pem file but you don't have public key on your side](#-2---you-have-pem-file-but-you-dont-have-public-key-on-your-side)
42
42
- [CASE 2: Access remote serivces via SSH local port forwarding](#case-2-access-remote-serivces-via-ssh-local-port-forwarding)
43
- - [2 -1 - Configuring SSH local port forwarding with --args or -a option](#2 -1---configuring-ssh-local-port-forwarding-with---args-or--a-option)
43
+ - [-1 - Configuring SSH local port forwarding with --args or -a option](#-1---configuring-ssh-local-port-forwarding-with---args-or--a-option)
44
44
- [Useful Links](#useful-links)
45
45
- [Contributing](#contributing)
46
46
@@ -191,41 +191,12 @@ $ kubectl ssh-jump
191
191
Usage:
192
192
kubectl ssh-jump < dest_node> [options]
193
193
194
- Options:
195
- < dest_node> Destination node name or IP address
196
- dest_node must start from the following letters:
197
- ASCII letters ' a' through ' z' or ' A' through ' Z' ,
198
- the digits ' 0' through ' 9' , or hyphen (' -' ).
199
- NOTE: Setting dest_node as ' jumphost' allows to
200
- ssh into SSH jump Pod as ' root' user
201
- -u, --user < sshuser> SSH User name
202
- -i, --identity < identity_file> Identity key file, or PEM(Privacy Enhanced Mail)
203
- -p, --pubkey < pub_key_file> Public key file
204
- -P, --port < port> SSH port for target node SSH server
205
- Defaults to 22
206
- -a, --args < args> Args to exec in ssh session
207
- --pod-template < file> Path to custom sshjump pod definition
208
- --skip-agent Skip automatically starting SSH agent and adding
209
- SSH Identity key into the agent before SSH login
210
- (=> You need to manage SSH agent by yourself)
211
- --cleanup-agent Clearning up SSH agent at the end
212
- The agent is NOT cleaned up in case that
213
- --skip-agent option is given
214
- --cleanup-jump Clearning up sshjump pod at the end
215
- Defaults to skip cleaning up sshjump pod
216
- -h, --help Show this message
217
-
218
- Example:
219
- Scenario1 - You have private & public SSH key on your side
220
- $ kubectl ssh-jump -u myuser -i ~ /.ssh/id_rsa -p ~ /.ssh/id_rsa.pub hostname
221
-
222
- Scenario2 - You have .pem file but you don' t have public key on your side
223
- $ kubectl ssh-jump -u ec2-user -i ~/.ssh/mykey.pem hostname
194
+ ...snip...
224
195
225
196
List of destination node...
226
197
Hostname Internal-IP
227
198
aks-nodepool1-18558189-0 10.240.0.4
228
- ...
199
+ ...snip...
229
200
```
230
201
231
202
@@ -235,13 +206,13 @@ aks-nodepool1-18558189-0 10.240.0.4
235
206
236
207
Suppose you have private & public SSH key on your side and you want to SSH to a node named ` aks-nodepool1-18558189-0 ` , execute the plugin with options like this:
237
208
238
- - usernaem: `myuser `
209
+ - usernaem: ` azureuser `
239
210
- identity:` ~/.ssh/id_rsa_k8s `
240
211
- pubkey:` ~/.ssh/id_rsa_k8s.pub ` )
241
212
242
213
``` sh
243
214
$ kubectl ssh-jump aks-nodepool1-18558189-0 \
244
- -u myuser -i ~/.ssh/id_rsa_k8s -p ~/.ssh/id_rsa_k8s.pub
215
+ -u azureuser -i ~ /.ssh/id_rsa_k8s -p ~ /.ssh/id_rsa_k8s.pub
245
216
```
246
217
247
218
> [ NOTE] you can try SSH into a node using node IP address (` Internal-IP ` ) instead of ` Hostname `
@@ -272,15 +243,15 @@ You can clean up sshjump pod at the end of the command with `--cleanup-jump` opt
272
243
273
244
``` sh
274
245
$ kubectl ssh-jump aks-nodepool1-18558189-0 \
275
- -u myuser -i ~/.ssh/id_rsa_k8s -p ~/.ssh/id_rsa_k8s.pub \
246
+ -u azureuser -i ~ /.ssh/id_rsa_k8s -p ~ /.ssh/id_rsa_k8s.pub \
276
247
--cleanup-jump
277
248
```
278
249
279
250
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.
280
251
281
252
``` sh
282
253
$ kubectl ssh-jump aks-nodepool1-18558189-0 \
283
- -u myuser -i ~ /.ssh/id_rsa_k8s -p ~ /.ssh/id_rsa_k8s.pub \
254
+ -u azureuser -i ~ /.ssh/id_rsa_k8s -p ~ /.ssh/id_rsa_k8s.pub \
284
255
--cleanup-agent
285
256
```
286
257
@@ -293,7 +264,7 @@ $ eval `ssh-agent`
293
264
$ ssh-add ~ /.ssh/id_rsa_k8s
294
265
# Then, run the plugin with --skip-agent
295
266
$ kubectl ssh-jump aks-nodepool1-18558189-0 \
296
- -u myuser -i ~ /.ssh/id_rsa_k8s -p ~ /.ssh/id_rsa_k8s.pub \
267
+ -u azureuser -i ~ /.ssh/id_rsa_k8s -p ~ /.ssh/id_rsa_k8s.pub \
297
268
--skip-agent
298
269
299
270
# At the end, run this if you want to kill the current agent
0 commit comments