Giter VIP home page Giter VIP logo

Comments (21)

mysticaltech avatar mysticaltech commented on May 25, 2024 2

@phaer You got it right, that was the file indeed, and Kured for OS, it manages everything and it works.

And indeed system-upgrade-controller for k3s, and it also manages everything.

Yes, ideally it would have been great to use only Kured, if the RPM channel now used (devel:kubic/k3s) gave recent versions and was updated regularly. But that is not the case. Also Richard Brown basically admitted that it is not a priority and that the best way to install k3s would be to use the install script, which I verified and it will be ideal indeed.

So we are left with k3s install with the vanilla install script (that supports MicroOS, between, it tests for it in the code) and either a custom way to upgrade and also create a /var/run/reboot-required file and have Kured do the reboot and some custom mechanism to switch the binary at boot.

Or we just use system-ugprade-controller that will do everything for us, without reboot, and fully independent of Kured. It will also execute rarely, just when new stable releases come down.

So I really think that in our case, it's still something really solid that we're planning to do here. Kured for OS, system-upgrade-controller for k3s, fresh from Github, without middlemen.

from terraform-hcloud-kube-hetzner.

phaer avatar phaer commented on May 25, 2024 1

In git, see the commit named "before move to k3os".

I think this refers to https://raw.githubusercontent.com/kube-hetzner/kube-hetzner/f308220bfe1236d735172e11b7f1841ca2597d14/manifests/upgrade/plans.yaml ?

I see that you also used kured back then. Is there a way to couple those two upgrade mechanisms? I understand that kured is responsible to upgrade our microos and system-upgrade-controller would be responsible for our k3s binary? That seems a bit sub-optimal for me, as It would complicate to i.e. schedule maintenance windows for a cluster.

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

Probably it's even simpler than that, probably the system upgrade controller can do the swap itself, see https://rancher.com/docs/k3s/latest/en/upgrades/automated/

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

That gives an example of how to run an upgrade script on the node: https://github.com/rancher/system-upgrade-controller/blob/master/examples/suse/sles.yaml

The system-upgrade-controller will just take care of the rest. Already had it running in the very first versions of this project when it was deployed on Fedora server. In git, see the commit named "before move to k3os".

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

Alright, folks, this is done and ready for testing, see the k3s-install branch.

⌛ It does take a bit longer than the other method because now k3s does not come pre-installed, and one more reboot is required after it installs, because of the k3s-selinux RPM package, for the new snapshot to take effect.

However, clusters get deployed only once - and then they are either agile or stuck. It's an added 5 minutes investment for a far more flexible future!

With this new method, k3s is vanilla, full-fat, and automatically upgrades by following the stable channel (so always latest, greatest, and safest), unless a node label is changed to k3s_upgrade=false.

You can also change the upgrade channel to the one you prefer want like latest, stable, testing, or even target a specific major version. See https://rancher.com/docs/k3s/latest/en/upgrades/basic/ and https://update.k3s.io/v1-release/channels.

ksnip_20220216-051905

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

kubectl get nodes

ksnip_20220216-052241

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

kubectl get pods -A

ksnip_20220216-052200

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

The next step will be to test the k3s automatic upgrade by changing the upgrade channel from stable to latest in plans.yaml and applying it again. By doing so, we should witness an upgrade to 1.23.x. Will do ASAP.

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

Ok, so just following the latest channel did not produce upgrade jobs, probably because it waits for new releases. But setting the version I wanted manually... I replace the channel like in the plans by version and Boom!

ksnip_20220216-113313

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

While it did the upgrades for each node, concurrency 1:

ksnip_20220216-112919

And after having completed:

ksnip_20220216-113054

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

kubectl get plans -n system-upgrade

ksnip_20220216-113228

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

kubectl get jobs -n system-upgrade

ksnip_20220216-113150

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

Now, will wait for a reboot by Kured to happen, to confirm that everything survives. Looking forward to any feedback.

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

Good news! We can probably get away without the second reboot if we use a combustion script to install the k3s-selinux RPM package. Will try ASAP.

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

Even better would be to install k3s through combustion itself. That would gain us some time, as indeed it would not require a second reboot, it just boots into the new snapshot.

To do so, both the config file and the combustion script need to be copied on the ignition partition into a combustion folder in rescue mode.

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

Just to confirm that it also rebooted with Kured after a MicroOS upgrade like a charm. Both systems work completely separately without interference.

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

Ok, called the whole k3s install from combustion, it fails. Probably because the right paths are not available yet. And also probably, because everything in combustion executes in a transactional-update shell.

Will try going just for the RPM, in the hope of avoiding the necessity of a second reboot.

ksnip_20220217-083346

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

Finally, k3s-selinux is being installed via combustion on MicroOS, and that indeed removes the need for the second reboot.

Loading repository data...
Reading installed packages...
Resolving package dependencies...
The following NEW package is going to be installed:
  k3s-selinux
1 new package to install.
Overall download size: 19.9 KiB. Already cached: 0 B. After the operation, additional 84.3 KiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package k3s-selinux-0.4-1.sle.noarch (1/1),  19.9 KiB ( 84.3 KiB unpacked)
Checking for file conflicts: [...done]
(1/1) Installing: k3s-selinux-0.4-1.sle.noarch [......done]
Executing %posttrans script 'k3s-selinux-0.4-1.sle.noarch.rpm' [....done]
Application returned with exit status 0.
Transaction completed.
tukit 3.6.2 started
ptions: close 2
Failure (dbus fatal exception).
New default snapshot is #2 (/.snapshots/2/snapshot).
Transaction completed.
Please reboot your machine to activate the changes and avoid data loss.
New default snapshot is #2 (/.snapshots/2/snapshot).

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

Thanks, @mnencia for the SSL error fix.

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

Here's a forced upgrade of k3s
ksnip_20220217-220751
to a specific version, working like a charm!

from terraform-hcloud-kube-hetzner.

mysticaltech avatar mysticaltech commented on May 25, 2024

Merged into master!

from terraform-hcloud-kube-hetzner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.