Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using k0sctl v0.12.6, fails to upgrade from k0s v1.23.3+k0s.0 to v1.23.3+k0s.1. #330

Closed
chattytak opened this issue Feb 17, 2022 · 6 comments

Comments

@chattytak
Copy link

As the title says.

It was working fine until k0sctl v0.12.6 + k0s v1.23.3+k0s.0, so I thought it might be a problem with k0s, not with k0sctl.

However, when I debugged it, I found that a new installation was performed and an error occurred, even though it was already installed.

If I run the install command directly with k0s v1.23.3+k0s.0 without using k0sctl while k0s is already installed, I get the same error, so I assume it is not a problem with k0s.

Therefore, I thought the problem was that k0sctl misunderstood that it was a new installation, not an upgrade of an existing version.
If it is an existing version upgrade, the install command should be skipped.

# k0sctl apply -c /etc/k0s/k0sctl.yaml --debug

...snip...
INFO[0003] ==> Running phase: Initialize the k0s cluster
INFO[0003] [ssh] x.x.x.x:22: installing k0s controller
DEBU[0003] [ssh] x.x.x.x:22: executing `/usr/local/bin/k0s install controller --config "/etc/k0s/k0s.yaml"`
DEBU[0003] [ssh] x.x.x.x:22: Error: failed to install k0s service: failed to install service: Init already exists: /etc/systemd/system/k0scontroller.service
INFO[0003] * Running clean-up for phase: Initialize the k0s cluster
ERRO[0003] apply failed - log file saved to /var/cache/k0sctl/k0sctl.log
FATA[0004] Process exited with status 1
@kke
Copy link
Contributor

kke commented Feb 18, 2022

This is related to #317

It should be fixed in 0.13.0-beta, care to confirm?

@chattytak
Copy link
Author

I hadn't looked at the past Issuer. I'm sorry.
I used the latest master and the upgrade was successful without any problems.
I hope the stable version will be released soon.

@leandropineda
Copy link

I'm facing a similar situation. I'm trying to upgrade a single node installation from 1.21 to the latest, using k0sctl v0.13.0-beta.2 but it fails:

INFO[0001] ==> Running phase: Initialize the k0s cluster 
INFO[0001] [ssh] 192.168.10.120:22: installing k0s controller 
DEBU[0001] [ssh] 192.168.10.120:22: executing `sudo -s /usr/local/bin/k0s install controller --single --config "/etc/k0s/k0s.yaml"` 
DEBU[0001] [ssh] 192.168.10.120:22: (stderr) Error: failed to install k0s service: failed to install service: Init already exists: /etc/systemd/system/k0scontroller.service 
INFO[0001] * Running clean-up for phase: Initialize the k0s cluster 
ERRO[0001] apply failed - log file saved to /home/leandro/.k0sctl/cache/k0sctl.log 
FATA[0002] Process exited with status 1                 

@kke
Copy link
Contributor

kke commented Feb 21, 2022

I'm facing a similar situation. I'm trying to upgrade a single node installation from 1.21 to the latest, using k0sctl v0.13.0-beta.2 but it fails:

It shouldn't go to "Initialize" if it has detected a running cluster 🤔

@cr1cr1
Copy link

cr1cr1 commented Sep 22, 2022

If k0scontroller.service is stopped, there is still this problem in kubectl 0.14.0 / k0s v1.24.4+k0s.0.
If is running, it does nothing to existing service (even though some parameters changed).

To overcome this issue when I need to add some parameters to k0s (for example):

  1. Add --force to k0sctl installFlags section
  2. run k0sctl apply. Will wait for initialization, but will never succeed since existing etcd members cannot be found so...
  3. Manually restart k0scontroller.service on all controllers

@kke
Copy link
Contributor

kke commented Sep 23, 2022

Related: #302

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants