alexellis / k3sup

bootstrap K3s over SSH in < 60s 🚀
https://github.com/sponsors/alexellis
Other
6.18k stars 375 forks source link

SSH key supplied on k3sup plan does not output #436

Closed rud813 closed 1 month ago

rud813 commented 2 months ago

Afternoon, i'm currently using k3sup 0.13.6.

It looks like when i try to do a k3sup plan on my json file, the ssh-key i've supplied doesn't carry over to the output.

here's my code to creat the plan: k3sup plan \ devices.json \ --user debian \ --servers 3 \ --server-k3s-extra-args "--disable traefik" \ --ssh-key "$HOME/.ssh/private_key.pem"

Here is the snippet of the output `

!/bin/sh

echo "Setting up primary server 1" k3sup install --host 10.0.0.180 \ --user debian \ --cluster \ --local-path kubeconfig \ --context default \ --k3s-extra-args "--disable traefik"

echo "Fetching the server's node-token into memory"

export NODE_TOKEN=$(k3sup node-token --host 10.0.0.180 --user debian)

echo "Setting up additional server: 2" k3sup join \ --host 10.0.0.181 \ --server-host 10.0.0.180 \ --server \ --node-token "$NODE_TOKEN" \ --user debian \ --k3s-extra-args "--disable traefik"

echo "Setting up additional server: 3" k3sup join \ --host 10.0.0.182 \ --server-host 10.0.0.180 \ --server \ --node-token "$NODE_TOKEN" \ --user debian \ --k3s-extra-args "--disable traefik"

echo "Setting up worker: 1" k3sup join \ --host 10.0.0.183 \ --server-host 10.0.0.180 \ --node-token "$NODE_TOKEN" \ --user debian

echo "Setting up worker: 2" k3sup join \ --host 10.0.0.184 \ --server-host 10.0.0.180 \ --node-token "$NODE_TOKEN" \ --user debian

echo "Setting up worker: 3" k3sup join \ --host 10.0.0.185 \ --server-host 10.0.0.180 \ --node-token "$NODE_TOKEN" \ --user debian

` Is there something i'm doing wrong? Thanks.

DaruZero commented 1 month ago

By giving a quick look at the code, it seems like the --ssh-key flag value is not parsed, although the flag itself is accepted

alexellis commented 1 month ago

Hi, k3sup relies on GitHub sponsors or me having spare time to donate to all you good people who enjoy using the tool.

You could send a Pull Request or sponsor me if you'd like to see this changed sooner.

The k3sup plan command doesn't support all flags and options that k3sup install / join does at this time. The option may show as available due to being added at a higher level generically.

Alex

alexellis commented 1 month ago

I've made these requested changes, but I'd encourage each of you to become a sponsor on whatever tier makes sense if you enjoy this tool and would like to see new features added.

rud813 commented 1 week ago

Thanks Alex. I appreciate it.

alexellis commented 1 week ago

Thank you for the sponsorship @rud813 💪

Do also have a look at inlets, you may like some of the ways you can combine it with k3s for a lab:

https://inlets.dev/blog/2024/08/15/inlets-operator-with-hetzner.html

https://inlets.dev/blog/2022/07/07/access-kubernetes-api-server.html