Skip to content

Commit 3bacbf5

Browse files
authored
SSH forwarding improvements (#118)
* Update rig for SSH forwarding fixes * Docs * Tweak
1 parent d04830d commit 3bacbf5

File tree

3 files changed

+49
-4
lines changed

3 files changed

+49
-4
lines changed

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ environment:
219219

220220
###### `spec.hosts[*].files` <sequence> (optional)
221221

222-
List of files to be uploaded to the host.
222+
List of files to be uploaded to the host.
223223

224224
Example:
225225

@@ -249,6 +249,51 @@ Override auto-detected OS distro. By default `k0sctl` detects the OS by reading
249249

250250
SSH connection options.
251251

252+
Example:
253+
254+
```yaml
255+
spec:
256+
hosts:
257+
- role: controller
258+
ssh:
259+
address: 10.0.0.2
260+
user: ubuntu
261+
keyPath: ~/.ssh/id_rsa
262+
```
263+
264+
It's also possible to tunnel connections through a bastion host. The bastion configuration has all the same fields as any SSH connection:
265+
266+
```yaml
267+
spec:
268+
hosts:
269+
- role: controller
270+
ssh:
271+
address: 10.0.0.2
272+
user: ubuntu
273+
keyPath: ~/.ssh/id_rsa
274+
bastion:
275+
address: 10.0.0.1
276+
user: root
277+
keyPath: ~/.ssh/id_rsa2
278+
```
279+
280+
SSH agent and auth forwarding are also supported, a host without a keyfile:
281+
282+
```yaml
283+
spec:
284+
hosts:
285+
- role: controller
286+
ssh:
287+
address: 10.0.0.2
288+
user: ubuntu
289+
```
290+
291+
```
292+
$ ssh-add ~/.ssh/aws.pem
293+
$ ssh -A user@jumphost
294+
user@jumphost ~ $ k0sctl apply
295+
```
296+
252297
###### `spec.hosts[*].ssh.address` <string> (required)
253298
254299
IP address of the host

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ require (
1515
github.com/go-playground/validator/v10 v10.4.1
1616
github.com/hashicorp/go-version v1.2.1
1717
github.com/k0sproject/dig v0.1.1
18-
github.com/k0sproject/rig v0.3.8
18+
github.com/k0sproject/rig v0.3.15
1919
github.com/logrusorgru/aurora v2.0.3+incompatible
2020
github.com/mattn/go-isatty v0.0.12
2121
github.com/segmentio/analytics-go v3.1.0+incompatible

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1
149149
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
150150
github.com/k0sproject/dig v0.1.1 h1:TmNoZtsCXF3jDzwSSEEwKjjD7fG5IyG0p8uvK+z1Wyo=
151151
github.com/k0sproject/dig v0.1.1/go.mod h1:rBcqaQlJpcKdt2x/OE/lPvhGU50u/e95CSm5g/r4s78=
152-
github.com/k0sproject/rig v0.3.8 h1:OJB5kfRemBIu0RenDL8iDzmEmtRwwVqQeS01YxQl4zY=
153-
github.com/k0sproject/rig v0.3.8/go.mod h1:2FBHQkR4t9VveNzFF4iNuMGx9T171kKPNuS2PFunASI=
152+
github.com/k0sproject/rig v0.3.15 h1:hq5GxDw3PiozvteAqlZZbiKMWTA5r8/0FSEeBirbXxg=
153+
github.com/k0sproject/rig v0.3.15/go.mod h1:2FBHQkR4t9VveNzFF4iNuMGx9T171kKPNuS2PFunASI=
154154
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
155155
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
156156
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=

0 commit comments

Comments
 (0)