Skip to content

Commit

Permalink
Remove support for hybrid cgroup mode
Browse files Browse the repository at this point in the history
All supporte k3s versions now support cgroups 2 (unified mode).

Signed-off-by: Jan Dubois <[email protected]>
  • Loading branch information
jandubois committed Jul 16, 2024
1 parent 4b556c8 commit f19bd02
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
2 changes: 1 addition & 1 deletion pkg/rancher-desktop/assets/lima-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ provision:
script: |
#!/bin/sh
set -o errexit -o nounset -o xtrace
[[ "${RC_CGROUP_MODE:-}" =~ "unified|hybrid|legacy" ]] || exit 0
RC_CGROUP_MODE=unified
if ! grep -q -E "^#?rc_cgroup_mode=\"$RC_CGROUP_MODE\"" /etc/rc.conf; then
sed -i -E "s/^#?rc_cgroup_mode=\".*\"/rc_cgroup_mode=\"$RC_CGROUP_MODE\"/" /etc/rc.conf
# avoid reboot loop if sed failed for any reason
Expand Down
16 changes: 0 additions & 16 deletions pkg/rancher-desktop/backend/lima.ts
Original file line number Diff line number Diff line change
Expand Up @@ -661,22 +661,6 @@ export default class LimaBackend extends events.EventEmitter implements VMBacken
},
});

// k3s supports cgroup v2 starting with 1.20.4
config.env ||= {};
config.env['RC_CGROUP_MODE'] = 'unified';
if (this.cfg?.kubernetes?.enabled && this.cfg.kubernetes.version) {
try {
if (semver.lt(this.cfg.kubernetes.version, '1.20.4')) {
config.env['RC_CGROUP_MODE'] = 'hybrid';
}
} catch {
// If we have an invalid version configured, ignore the error; we'll
// report the error later when trying to download the version. In that
// case we will fall back to the latest stable version, which should be
// new enough to support cgroups v2.
}
}

// Alpine can boot via UEFI now
if (config.firmware) {
config.firmware.legacyBIOS = false;
Expand Down

0 comments on commit f19bd02

Please sign in to comment.