k3sup
k3sup copied to clipboard
Leverage SSH Config
Hi there,
This is more of a question than an issue (so this can be closed upon reply).
My target VM's are behind a NAT that provide SSH access via a JumpProxy directive (jump host) in an ssh config file.
IE
Host srv
HostName 10.0.0.10
User dustin
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa
Host k8c
HostName 192.168.122.22
ProxyJump srv
User dustin
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa
Is there a way to leverage the jump host with k3sup?
Thank you very much for your time.
I think I have a related question. Vagrant also provides a custom ssh config vagrant ssh-config to ssh into the VMs.
Host node1
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile /foo/.vagrant/machines/node1/virtualbox/private_key
IdentitiesOnly yes
LogLevel FATAL
ForwardAgent yes
Host node2
HostName 127.0.0.1
User vagrant
Port 2200
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile /foo/.vagrant/machines/node2/virtualbox/private_key
IdentitiesOnly yes
LogLevel FATAL
ForwardAgent yes
But I am unsure how to leverage the ssh config with k3ups. Does it even take into account the ssh config at all?
Hello! This would be really helpful for provisioning on machines behind nat. any hope to get this soon? @alexellis Thanks for the great util!
I'm having the same experience with hashi-up, but there is actually a workaround to install k3s with k3sup on targets behind a jump host.
I'm sure the ssh client will use your SSH config, so you should be able to create a connection with local port forwarding, eg:
My SSH config:
Host 192.168.5.101
ProxyJump [email protected]
First bring the SSH service of the target to your local machine:
ssh -L 2222:localhost:22 [email protected]
Now you can install k3s with k3sup, using the local port:
k3sup install --host localhost --ssh-port 2222 ...
Please use the solution proposed by @jsiebens
/lock
/set title: Installation via bastion host