k0sctl icon indicating copy to clipboard operation
k0sctl copied to clipboard

k0sctl fails when trying k0s install on OpenRC when it's already installed

Open twz123 opened this issue 3 years ago • 4 comments
trafficstars

k0sctl 0.13.0-rc.1 will sometimes try to install the k0s service when it's already installed. This fails at least on OpenRC:

time="29 Mar 22 16:08 CEST" level=info msg="[ssh] 10.83.134.82:22: installing k0s controller" time="29 Mar 22 16:08 CEST" level=debug msg="[ssh] 10.83.134.82:22: executing sudo -s /usr/local/bin/k0s install controller --enable-worker --config \"/etc/k0s/k0s.yaml\"" time="29 Mar 22 16:08 CEST" level=debug msg="[ssh] 10.83.134.82:22: Error: failed to install k0s service: failed to install service: Init already exists: /etc/init.d/k0scontroller"

twz123 avatar Mar 29 '22 14:03 twz123

A workaround is to add "--force" to spec.hosts.*.installFlags in the configuration file. But somehow I feel this shouldn't be necessary.

twz123 avatar Mar 30 '22 14:03 twz123

Okay, the --force flag is a recent addition and not part of any k0s release, yet.

There's also #302, but it seems different, since I didn't change any install flags, yet k0sctl tries to re-install k0s on the target hosts.

twz123 avatar Mar 31 '22 09:03 twz123

Installed but not running perhaps?

kke avatar Apr 04 '22 06:04 kke

Installed but not running perhaps?

Yes, I think so. It's happening after #357 stopped k0s on the hosts, but failed to update the binary. Any subsequent run of k0sctl then fails because of this issue.

twz123 avatar Apr 04 '22 07:04 twz123