Skip to content

[Kubernetes] Remove cgroup driver cgroupfs config#25719

Merged
yxieca merged 4 commits intosonic-net:masterfrom
isabelmsft:dev/isl/update_img_cgroupfs
Mar 12, 2026
Merged

[Kubernetes] Remove cgroup driver cgroupfs config#25719
yxieca merged 4 commits intosonic-net:masterfrom
isabelmsft:dev/isl/update_img_cgroupfs

Conversation

@isabelmsft
Copy link
Contributor

@isabelmsft isabelmsft commented Feb 27, 2026

Why I did it

202511 includes migration to Debian 13 from Debian 12. Previous kubelet cgroupdriver configuration was set to cgroupfs for compatibility with Debian 12. Debian 13 expects systemd cgroupdriver, which is the default configuration of kubelet in Kubernetes v1.22.2- so we should remove the explicit cgroupfs cgroupdriver configuration in SONiC OSVersion >= 202511.

Work item tracking
  • Microsoft ADO (number only):

How I did it

remove the explicit cgroupfs cgroupdriver configuration in SONiC OSVersion >= 202511

How to verify it

Build image and join node to cluster

admin@str5-sn5640-1:~$ cat /etc/default/kubelet
KUBELET_EXTRA_ARGS="--resolv-conf=/etc/resolv.conf --node-ip=::"
admin@str5-sn5640-1:~$ sudo cat /var/lib/kubelet/config.yaml | grep cgroupDriver
cgroupDriver: systemd
admin@str5-sn5640-1:~$ sudo journalctl -u kubelet | grep -i cgroup
admin@str5-sn5640-1:~$ sudo docker info | grep -i cgroup
 Cgroup Driver: systemd
 Cgroup Version: 2
  cgroupns

Which release branch to backport (provide reason below if selected)

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

Copilot AI review requested due to automatic review settings February 27, 2026 01:50
@isabelmsft isabelmsft requested a review from lguohan as a code owner February 27, 2026 01:50
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 27, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the explicit --cgroup-driver=cgroupfs configuration from kubelet to support Debian 13 (trixie) migration in SONiC 202511. Debian 13 expects the systemd cgroup driver, which is the default in Kubernetes v1.22.2+, making the explicit cgroupfs configuration unnecessary and incompatible.

Changes:

  • Remove --cgroup-driver=cgroupfs from KUBELET_EXTRA_ARGS in kubelet configuration
  • Maintain --resolv-conf=/etc/resolv.conf --node-ip=:: flags for proper kubelet operation
Comments suppressed due to low confidence (1)

files/build_templates/sonic_debian_extension.j2:569

  • This change removes the explicit cgroupfs cgroup driver configuration unconditionally. While the PR description correctly states this is for Debian 13 migration in 202511+, the code itself has no version conditional.

This approach relies on branch-based version management (only merging to master and 202511, which are on Debian 13/trixie) rather than runtime conditionals. This is acceptable, but please ensure this PR is NEVER backported to branches still on Debian 12 (bookworm), such as 202505, 202411, or earlier, as Debian 12's systemd expects cgroupfs for kubelet compatibility. Backporting to those branches would break Kubernetes functionality.

Consider adding a comment in the code explaining that this configuration is appropriate for Debian 13+ (trixie) where systemd cgroup driver is the default, to prevent accidental backports to Debian 12 branches.

echo 'KUBELET_EXTRA_ARGS="--resolv-conf=/etc/resolv.conf --node-ip=::"' | sudo tee -a  $FILESYSTEM_ROOT/etc/default/kubelet

@isabelmsft isabelmsft force-pushed the dev/isl/update_img_cgroupfs branch from 6daa47e to ad059bc Compare February 27, 2026 01:55
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: isabel <[email protected]>
Signed-off-by: isabel <[email protected]>
@isabelmsft isabelmsft force-pushed the dev/isl/update_img_cgroupfs branch from ad059bc to 574b63d Compare February 27, 2026 02:05
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@hdwhdw hdwhdw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Debian 13 expects systemd cgroup driver, which is already kubelet's default — the explicit cgroupfs override was causing the mismatch.

{% if include_kubernetes == "y" %}
# Point to kubelet to /etc/resolv.conf
#
echo 'KUBELET_EXTRA_ARGS="--resolv-conf=/etc/resolv.conf --cgroup-driver=cgroupfs --node-ip=::"' | sudo tee -a $FILESYSTEM_ROOT/etc/default/kubelet

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after removing cgroup driver settings, then what's the exact driver kubelet uses now ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kubernetes v1.22.2 uses systemd by default:

admin@str5-sn5640-1:~$ sudo cat /var/lib/kubelet/config.yaml | grep cgroupDriver
cgroupDriver: systemd

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 25719 in repo sonic-net/sonic-buildimage

@isabelmsft
Copy link
Contributor Author

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 25719 in repo sonic-net/sonic-buildimage

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@isabelmsft isabelmsft force-pushed the dev/isl/update_img_cgroupfs branch from 2b13db5 to 574b63d Compare March 6, 2026 04:54
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yxieca
Copy link
Contributor

yxieca commented Mar 11, 2026

/azpw ms_conflict

1 similar comment
@StormLiangMS
Copy link
Contributor

/azpw ms_conflict

@yxieca yxieca merged commit ee44689 into sonic-net:master Mar 12, 2026
25 of 26 checks passed
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202511: #26205

@StormLiangMS
Copy link
Contributor

Cherry-pick PR to 202511: #26205

@liushilongbuaa could you check why it is not included when the cherrpick PR was merged? I noticed several PRs like this.

@liushilongbuaa
Copy link
Contributor

@StormLiangMS , it is not merged by automation. Vineet merged the PR only 9 minutes after PR checker passed.
automation will merge PR in 1 hour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants