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

fix(install): Fedora Silverblue detection for k3s-selinux #11167

Closed

Conversation

AdamNowotny
Copy link

Proposed Changes

Fixes detection of Fedora Silverblue based systems so SELinux can be configured correctly (it's required for services running in systemd).

The first time the script is run there will still be an error, because reboot is required to install the k3s-selinux RPM.
After the reboot, the script now correctly applies the rest of the changes needed.

It's another "else if" but consistent with the existing detection code and shouldn't affect any other systems.

# cat /etc/os-release 
NAME="Bluefin"
VERSION="40.20241021.0 (Silverblue)"
ID=bluefin
ID_LIKE="fedora"
VERSION_ID=40
VERSION_CODENAME="Archaeopteryx"
PLATFORM_ID="platform:f40"
PRETTY_NAME="Bluefin-dx 40 (FROM Fedora Silverblue)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:universal-blue:bluefin:40"
DEFAULT_HOSTNAME="bluefin"
HOME_URL="https://projectbluefin.io"
DOCUMENTATION_URL="https://docs.projectbluefin.io"
SUPPORT_URL="https://github.com/ublue-os/bluefin/issues/"
BUG_REPORT_URL="https://github.com/ublue-os/bluefin/issues/"
SUPPORT_END=2025-05-13
VARIANT="Silverblue"
VARIANT_ID=bluefin-dx-nvidia
OSTREE_VERSION='40.20241021.0'
BUILD_ID="78bbc1a"

Types of Changes

Bugfix affecting Fedora Silverblue based systems only.

Verification

I tested the installation procedure on Bluefin, now just a reboot is needed but no more manual changes to the script.

export K3S_SELINUX=true
./install.sh

After installing k3s-linux and reboot, run the commands again and k3s will be installed correctly now.
The only small issue that is still there is the need to start the service when installing as server:

systemctl start k3s.service

Fixing this would require some refactoring first, so opted for minimum amount of code fixing the main problem.

Linked Issues

Related to #9361

User-Facing Change

install script now passes fine without the need to introduce temporary changes to it.

# ./install.sh 
[INFO]  Finding release for channel stable
[INFO]  Using v1.30.5+k3s1 as release
[INFO]  Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.30.5+k3s1/sha256sum-amd64.txt
[INFO]  Skipping binary downloaded, installed k3s matches hash
[INFO]  ****** Fedora Silverblue detected *******
[INFO]  Finding available k3s-selinux versions
Checking out tree ea698b4... done
[...]
Resolving dependencies... done
No change.
[INFO]  Skipping /usr/local/bin/kubectl symlink to k3s, already exists
[INFO]  Skipping /usr/local/bin/crictl symlink to k3s, already exists
[INFO]  Skipping /usr/local/bin/ctr symlink to k3s, command exists in PATH at /usr/bin/ctr
[INFO]  Creating killall script /usr/local/bin/k3s-killall.sh
[INFO]  Creating uninstall script /usr/local/bin/k3s-uninstall.sh
[INFO]  env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO]  systemd: Creating service file /etc/systemd/system/k3s.service
[INFO]  systemd: Enabling k3s unit
Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service.

Further Comments

@AdamNowotny AdamNowotny requested a review from a team as a code owner October 24, 2024 15:50
@dereknola
Copy link
Member

@AdamNowotny can you take a look at #11170 instead, and try it out with your setup (i don't have an easy Silverblue VM setup). That PR should hopefully cover more variants at once and stop this piecemeal update to the install script.

@AdamNowotny
Copy link
Author

Closed in favor of #11170

@AdamNowotny AdamNowotny deleted the install-fedora-silverblue branch October 25, 2024 17:52
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.

2 participants