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

Bump k3s and rke2 to v1.31.1 #93

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

fhemberger
Copy link
Contributor

Update k3s and rke2 to v1.31.1

Didn't know if you want to keep v1.30.5 and v1.29.9 for backwards-compatibility, so I kept them in release_build_versions.txt. If you only want to build the latest release, I can update the PR as well.

@fhemberger
Copy link
Contributor Author

Build seems to run successfully, but I can't merge the sysext:

./create_k3s_sysext.sh v1.31.1+k3s1 k3s-v1.31.1+k3s1-x86-64
mv k3s-v1.31.1+k3s1-x86-64 /etc/extensions/k3s.raw
systemd-sysext refresh
Failed to read metadata for image k3s: No medium found

Any ideas? 🤔
(Running Debian 6.10.11-1)

@fhemberger fhemberger force-pushed the feat/update-k3s-rke2 branch from 3b7a1a1 to ce0d092 Compare October 10, 2024 06:39
@ader1990
Copy link
Contributor

Build seems to run successfully, but I can't merge the sysext:

./create_k3s_sysext.sh v1.31.1+k3s1 k3s-v1.31.1+k3s1-x86-64
mv k3s-v1.31.1+k3s1-x86-64 /etc/extensions/k3s.raw
systemd-sysext refresh
Failed to read metadata for image k3s: No medium found

Any ideas? 🤔 (Running Debian 6.10.11-1)

Will try it out on Flatcar and report back, there might be the issue with the versioning. Just to make sure, you built the extension and tested it on Debian and not Flatcar?

@fhemberger
Copy link
Contributor Author

Yes, I built and tested it on Debian (I was trying to use the same sysext across distros).

@fhemberger
Copy link
Contributor Author

fhemberger commented Oct 10, 2024

@ader1990 Flatcar doesn't ship with mksquashfs, can't use it for building sysexts.

Docs need improvement how to actually build/test/release sysexts in a reliable manner.
/cc @t-lo @tormath1

EDIT: #94

@fhemberger
Copy link
Contributor Author

Okay, no idea what the issue was, but building works now for me on Debian:

# Installed `jq` and `gawk` which were missing before
sudo apt update -qq && sudo apt install -yqq \
            curl \
            jq \
            squashfs-tools \
            xz-utils \
            gawk

~/sysext-bakery$ ./create_k3s_sysext.sh v1.31.1+k3s1 k3s

~/sysext-bakery/k3s/usr/local/bin ~/sysext-bakery
~/sysext-bakery
Parallel mksquashfs: Using 2 processors
Creating 4.0 filesystem on k3s.raw, block size 131072.
[========================================================================\] 525/525 100%

Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072
        compressed data, compressed metadata, compressed fragments,
        compressed xattrs, compressed ids
        duplicates are removed
Filesystem size 59645.56 Kbytes (58.25 Mbytes)
        89.37% of uncompressed filesystem size (66741.00 Kbytes)
Inode table size 749 bytes (0.73 Kbytes)
        28.89% of uncompressed inode table size (2593 bytes)
Directory table size 211 bytes (0.21 Kbytes)
        60.81% of uncompressed directory table size (347 bytes)
Number of duplicate files found 0
Number of inodes 16
Number of files 4
Number of fragments 1
Number of symbolic links 3
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 9
Number of hard-links 0
Number of ids (unique uids + gids) 1
Number of uids 1
        root (0)
Number of gids 1
        root (0)
Created k3s.raw

~/sysext-bakery$ sudo mv k3s.raw /etc/extensions/k3s.raw
~/sysext-bakery$ sudo systemd-sysext refresh
Using extensions 'k3s'.
Merged extensions into '/usr'.

~/sysext-bakery$ k3s --version
k3s version v1.31.1+k3s1 (452dbbc1)
go version go1.22.6

@ader1990
Copy link
Contributor

@ader1990 Flatcar doesn't ship with mksquashfs, can't use it for building sysexts.

Docs need improvement how to actually build/test/release sysexts in a reliable manner. /cc @t-lo @tormath1

EDIT: #94

Flatcar can be used as a Docker host and you can build the sysexts using the Flatcar SDK Docker image (or any other Docker image that has the requirements). Moreover, if you use a volume mount to the host /etc/extensions/, you can build and copy directly the sysext.

docker run -it ghcr.io/flatcar/flatcar-sdk-arm64:4081.0.0 /bin/bash

# in the docker container
cd ~
git clone https://github.com/flatcar/sysext-bakery
cd sysext-bakery
./create_k3s_sysext.sh v1.29.2+k3s1 K3S

I think it is also worth documenting this workflow too, so that any Flatcar user can re-use their Flatcar instance and dev tools to build the systemd-sysexts.

@ader1990
Copy link
Contributor

As the SDK container is quite large, there is another way, way faster, to leverage the flatcar_developer_container.bin.

wget https://bincache.flatcar-linux.net/images/amd64/4116.0.0/flatcar_developer_container.bin.bz2
bzip2 -d -k flatcar_developer_container.bin.bz2
sudo systemd-nspawn \
    --bind=/etc/extensions/ \
    --image=flatcar_developer_container.bin

### in the systemd-nspawn container
git clone https://github.com/flatcar/sysext-bakery
cd sysext-bakery
./create_k3s_sysext.sh v1.29.2+k3s1 k3s

sudo mv k3s.raw /etc/extensions

### exit the container and refresh systemd-sysext

yq is not yet in the developer container, but I think we can add it easily.

Notable docs:

https://www.flatcar.org/docs/latest/reference/developer-guides/kernel-modules/
https://gist.github.com/vbatts/9af92a341611751dc3a157f204a84973

@fhemberger
Copy link
Contributor Author

@ader1990 Update built successfully, could you please merge it and update the k3s/rke2 releases?

@tormath1
Copy link
Contributor

Build seems to run successfully, but I can't merge the sysext:

./create_k3s_sysext.sh v1.31.1+k3s1 k3s-v1.31.1+k3s1-x86-64
mv k3s-v1.31.1+k3s1-x86-64 /etc/extensions/k3s.raw
systemd-sysext refresh
Failed to read metadata for image k3s: No medium found

Any ideas? 🤔 (Running Debian 6.10.11-1)

For what is worth, this has failed because of this mv k3s-v1.31.1+k3s1-x86-64 /etc/extensions/k3s.raw if the extension is built with a given name, it has to stay the same - that's why it worked the second time (you used k3s as sysext name)

@fhemberger
Copy link
Contributor Author

@tormath1 Thank you!

@ader1990 ader1990 merged commit 8cc25e0 into flatcar:main Oct 23, 2024
@fhemberger fhemberger deleted the feat/update-k3s-rke2 branch October 23, 2024 16:39
@fhemberger
Copy link
Contributor Author

@ader1990 @tormath1 Could you please also trigger a new release for these changes, so they get added as downloadable artifacts? Thanks!

@tormath1
Copy link
Contributor

@ader1990 @tormath1 Could you please also trigger a new release for these changes, so they get added as downloadable artifacts? Thanks!

Hello, it should be good now: https://github.com/flatcar/sysext-bakery/releases/tag/latest

@fhemberger
Copy link
Contributor Author

Awesome, thanks!

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

Successfully merging this pull request may close these issues.

3 participants