flatcar / sysext-bakery

Recipes for baking systemd-sysext images
Apache License 2.0
72 stars 37 forks source link

ADD create_rke2_sysext.sh #68

Closed johanneskastl closed 6 months ago

johanneskastl commented 7 months ago

add script to create a RKE2 sysext

Add a new script that builds a sysext containing the Rancher rke2 binary and its systemd units.

How to use

./create_rke2_sysext.sh v1.29.2+rke2r1 rke2-v1.29.2+rke2r1

This will download rke2 in version v1.29.2+rke2r1 and create a sysext named rke2-v1.29.2+rke2r1.raw.

Testing done

I tested the script locally and got a working sysext.

johanneskastl commented 6 months ago

Would it make sense to use ${VARIABLE:?} to make sure nothing bad happens if for $REASONS a variable is unset? https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Shell-Parameter-Expansion

johanneskastl commented 6 months ago

Do we need the RELOAD=1 in this one as well?

pothos commented 6 months ago

Would it make sense to use ${VARIABLE:?} to make sure nothing bad happens if for $REASONS a variable is unset?

The variables are set in the script and if they aren't then the script is wrong. shellcheck should tell.

Do we need the RELOAD=1 in this one as well?

I see that rke2-server.service and rke2-agent.service are included, so yes. And we also need the drop-in (see https://github.com/flatcar/sysext-bakery/pull/69#discussion_r1582889217) for them to be started on load.

johanneskastl commented 6 months ago

reload see b4e62e6

johanneskastl commented 6 months ago

Do we need the RELOAD=1 in this one as well?

I see that rke2-server.service and rke2-agent.service are included, so yes. And we also need the drop-in (see #69 (comment)) for them to be started on load.

I'll adapt this once the discussion on enabling/disabling in #69 is finished. :-)

johanneskastl commented 6 months ago

Rebased on latest state in main, added README section for rke2 (and headings to better structure the sections with wasmcloud, k3s and rke)