hetzner-k3s icon indicating copy to clipboard operation
hetzner-k3s copied to clipboard

missing wireguard package on cluster setup

Open hroost opened this issue 1 year ago • 4 comments

Thanks for this nice tool!

I found that if the enable_encryption: true then cluster's setup not finishing correctly due missing wireguard package. I guess this tool should add apt install wireguard -y into post_create_commands (if encryption is enabled) to satisfy dependencies

hroost avatar Jul 13 '22 13:07 hroost

Hi, wireguard is automatically installed, see https://github.com/vitobotta/hetzner-k3s/blob/cc519dff94de48eecf6e22448864ca98627db977/lib/hetzner/infra/server.rb#L63

vitobotta avatar Jul 13 '22 14:07 vitobotta

I'm running tool with config from README with k3s_version: v1.21.14+k3s1

...k3s has been deployed to first master.
...
...k3s has been deployed to worker (hz-test-k3s-cpx11-pool-small-worker1).

Deploying Hetzner Cloud Controller Manager...
The connection to the server 188.34.162.61:6443 was refused - did you specify the right host or port?
Command failed: non-zero exit code

And if I checking logs on master - k3s service constantly restarting with error:

hz-test-k3s-cpx21-master1 k3s[3574]: time="2022-07-14T10:21:34.865290478Z" level=fatal msg="flannel exited: failed to run command: wg genkey | tee /var/lib/rancher/k3s/agent/etc/flannel/privatekey | wg pubkey Err: exit status 127 Output: sh: wg: not found\nsh: wg: not found"
hz-test-k3s-cpx21-master1 systemd[1]: k3s.service: Main process exited, code=exited, status=1/FAILURE
hz-test-k3s-cpx21-master1 systemd[1]: k3s.service: Failed with result 'exit-code'.

But adding to config's post_create_commands step with installation of wireguard solve this error and cluster setuping correctly.

hroost avatar Jul 14 '22 10:07 hroost

Ok, this is weird. I will do more testing in the weekend

vitobotta avatar Jul 14 '22 14:07 vitobotta

Hi, sorry for the delay with this. I am having some time to work on this project now so I checked, but unfortunately I couldn't reproduce the issue. For the me the wireguard package gets installed correctly. Have you been able to reproduce with more clusters in the meantime?

vitobotta avatar Aug 12 '22 14:08 vitobotta

Hi, unfortunately, couldn't reproduce the issue mainly (I guess) because I've switched to v0.5.9, newer k3s versions, and wireguard-native. Anyway, thanks for your time!

hroost avatar Aug 23 '22 11:08 hroost