Skip to content

Commit 45b6018

Browse files
committed
release v0.3.2
1 parent 630451a commit 45b6018

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@
22

33
All notable changes to the "kubectl-plugin-ssh-jump" extension will be documented in this file.
44

5+
## 0.3.2
6+
7+
- Changed a validation for destination name to support valid characters of hostname for SSH destination node that can start from ASCII letters 'a' through 'z' (in a case-insensitive manner), the digits '0' through '9', or the hyphen ('-'). Ref [RFC952](https://tools.ietf.org/html/rfc952) for valid characters of hostname.
8+
59
## 0.3.1
10+
611
- fixed typo: missing char ( [PR#3](https://github.com/yokawasa/kubectl-plugin-ssh-jump/pull/3), thanks to @iuryfukuda )
712

813
## 0.3.0
14+
915
- Added Args param to exec in ssh session ( [PR#2](https://github.com/yokawasa/kubectl-plugin-ssh-jump/pull/2), thanks to @iuryfukuda )
1016

1117
## 0.2.0
18+
1219
- Added -P|--port options for specifing SSH port that target node is listening (default 22)
1320
- Added -o "StrictHostKeyChecking=no" for ssh login options
1421
- Changed the way to SSH login via SSH Jump Pod from using "-J" to using "ProxyCommand"

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ Usage:
8989
kubectl ssh-jump <dest_node> [options]
9090
9191
Options:
92-
<dest_node> Destination node IP
92+
<dest_node> Destination node name or IP address
93+
dest_node must start from the following letters:
94+
ASCII letters 'a' through 'z' or 'A' through 'Z',
95+
the digits '0' through '9', or hyphen ('-'
9396
-u, --user <sshuser> SSH User name
9497
-i, --identity <identity_file> Identity key file
9598
-p, --pubkey <pub_key_file> Public key file
@@ -134,7 +137,10 @@ Usage:
134137
kubectl ssh-jump <dest_node> [options]
135138

136139
Options:
137-
<dest_node> Destination node IP
140+
<dest_node> Destination node name or IP address
141+
dest_node must start from the following letters:
142+
ASCII letters 'a' through 'z' or 'A' through 'Z',
143+
the digits '0' through '9', or hyphen ('-')
138144
-u, --user <sshuser> SSH User name
139145
-i, --identity <identity_file> Identity key file
140146
-p, --pubkey <pub_key_file> Public key file
@@ -154,10 +160,11 @@ Example:
154160
....
155161

156162
List of destination node...
157-
Hostname
158-
aks-nodepool1-18558189-0
159-
aks-nodepool1-18558189-1
160-
aks-nodepool1-18558189-2
163+
Hostname Internal-IP
164+
aks-nodepool1-18558189-0 10.240.0.4
165+
aks-nodepool1-18558189-1 10.240.0.5
166+
aks-nodepool1-18558189-2 10.240.0.6
167+
161168
```
162169
163170
Then, SSH into a node `aks-nodepool1-18558189-0` with options like:
@@ -168,6 +175,7 @@ Then, SSH into a node `aks-nodepool1-18558189-0` with options like:
168175
$ kubectl ssh-jump aks-nodepool1-18558189-0 \
169176
-u azureuser -i ~/.ssh/id_rsa_k8s -p ~/.ssh/id_rsa_k8s.pub
170177
```
178+
> [NOTE] you can try SSH into a node using node IP address (`Internal-IP`) instead of `Hostname`
171179
172180
As explained in usage secion, `username`, `identity`, `pubkey` options are cached, therefore you can omit these options afterward.
173181

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.1
1+
0.3.2

kubectl-ssh-jump

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ help(){
2121
options(){
2222
cat <<"EOF"
2323
Options:
24-
<dest_node> Destination node IP
24+
<dest_node> Destination node name or IP address
25+
dest_node must start from the following letters:
26+
ASCII letters 'a' through 'z' or 'A' through 'Z',
27+
the digits '0' through '9', or hyphen ('-')
2528
-u, --user <sshuser> SSH User name
2629
-i, --identity <identity_file> Identity key file
2730
-p, --pubkey <pub_key_file> Public key file
@@ -65,7 +68,7 @@ EOF
6568

6669
get_node_list(){
6770
echo "List of destination node..."
68-
kubectl get no -o custom-columns=Hostname:.metadata.name
71+
kubectl get no -o custom-columns=Hostname:.metadata.name,Internal-IP:'{.status.addresses[?(@.type=="InternalIP")].address}'
6972
echo ""
7073
}
7174

@@ -138,7 +141,7 @@ run_ssh_node(){
138141
kubectl port-forward sshjump 2222:22 2>/dev/null &
139142
pid_port_forward=$!
140143
# Inject public SSH key to sshjump
141-
cat ${pubkey} | kubectl exec -i sshjump -- /bin/bash -c "cat >> /root/.ssh/authorized_keys"
144+
cat ${pubkey} | kubectl exec -i sshjump -- /bin/bash -c "cat > /root/.ssh/authorized_keys"
142145

143146
# Using the SSH Server as a jumphost (via port-forward proxy), ssh into the desired Node
144147
ssh -i ${identity} -p ${port} ${sshuser}@${destnode} \
@@ -189,7 +192,7 @@ plugin_main() {
189192
sshargs="$2"
190193
nSkip=2
191194
;;
192-
[a-z]*)
195+
[0-9a-zA-Z-]*)
193196
destnode=$1
194197
;;
195198
*)

0 commit comments

Comments
 (0)