k0sproject / k0sctl

A bootstrapping and management tool for k0s clusters.
Other
393 stars 77 forks source link

Specify install location for k0s #589

Open khumps opened 1 year ago

khumps commented 1 year ago

The machine I am trying to install k0s on has a read-only /usr partition This causes the install command for k0s to fail

executing `sudo -s -- install -m 0750 -o root -g root \"/tmp/tmp.lNe2DW8TD2\" \"/usr/local/bin/k0s\
(stderr) install: cannot create regular file '/usr/local/bin/k0s': Read-only file system

https://docs.k0sproject.io/v1.28.2+k0s.0/troubleshooting/#k0s-not-working-with-read-only-usr does not seem to address what to do if you can not install the k0s binary in /usr.

till commented 1 year ago

k0sctl should handle that already. Which OS are you using? I am using Flatcar Linux, also comes with readonly /usr.

till commented 1 year ago

(I am also using a profile and k0s ends up in /opt)

kke commented 1 year ago

Flatcar is the only one that has a custom K0sBinaryPath() currently.

kke commented 1 year ago

It would be possible to detect when /usr is readonly and then use /opt as fallback. I'd rather not make it configurable because I have a hunch that it can open a new can of worms.

kke commented 1 year ago

But knowing which OS you're running on @khumps would be interesting.