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

kernel version should be 4.19+; recommend version 5.8 for cgroup v2 #37

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

pacoxu
Copy link
Member

@pacoxu pacoxu commented Jul 24, 2024

For kernel long term support, see https://wiki.linuxfoundation.org/civilinfrastructureplatform/start and https://endoflife.date/linux

  • 4.4 & 4.19 are selected as kernel Super Long Term Support (SLTS), and the Civil Infrastructure Platform will provide support until at least 2026.
  • For cgroup v2, Kubernetes recommends to use 5.8 and later, and in runc docs, the minimal version is 4.15 and 5.2+ is recommended.

Other comments that may be related:

In Kubernetes 1.31, cgroup v1 is moved to maintenance mode and 4.14 LTS EOF in Jan 2024 (linux, LTS) , besides, centos 7 is EOL in June 30, 2024. I chosen 4.15 as runc.

More details can be found in kubernetes/kubernetes#116799.

The v1.31 KEP kubernetes/enhancements#4569

Other minimal kernel version candidates

  • kernel 4.5 announced that cgroup v2 is not experimental anymore, as it supports io/pids/memory.
  • runc recommends 5.2+ as 5.2 supports freezer.

@k8s-ci-robot k8s-ci-robot added sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/node Categorizes an issue or PR as relevant to SIG Node. labels Jul 24, 2024
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 24, 2024
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 24, 2024
@pacoxu
Copy link
Member Author

pacoxu commented Jul 24, 2024

/assign @neolit123 @SataQiu

Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

we could show an error for any version that is not in that list of Versions and we don't need a RecommendedVersions or warnings IMO.
the error message could be x is not in the list of recommended versions. %s, where %s is a VersionsNote from the KernelSpec API.

validators/kernel_validator.go Outdated Show resolved Hide resolved
validators/kernel_validator.go Outdated Show resolved Hide resolved
validators/kernel_validator_test.go Outdated Show resolved Hide resolved
// cgroup v2: Kubernetes recommended kernel version
// https://kubernetes.io/docs/concepts/architecture/cgroups/
RecommendedVersions: []string{`^5\.[8-9].*$`, `^5\.[1-9][0-9].*$`, `^([6-9]|[1-9][0-9]+)\.([0-9]+)\.([0-9]+).*$`}, // Requires 5.8+, or newer for cgroup v2
RecommendedNote: "kernel version should >= '4.15', and 5.8+ is recommended.",
Copy link
Member

Choose a reason for hiding this comment

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

can be called VersionsNote

from a discussion on slack we had:

the checks are regexp based so could be 4.4 == ok, 4.19 == ok, any other >= 4.19 version == ok, any other version == err.

so in this note we can say that all those 4.x LTS versions are supported but the recommendation is to use 4.15 or 5.8+.

Copy link
Member Author

Choose a reason for hiding this comment

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

VersionsNote: "kernel version should be in maintenance, at least 4.4 or 4.19+, and to use cgroup v2, 5.8+ is recommended.",

update it as above..

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 25, 2024
@pacoxu pacoxu force-pushed the cgroupv2-kernel-min-4.15 branch 2 times, most recently from a313836 to 42443a8 Compare July 25, 2024 02:57
@pacoxu pacoxu changed the title Cgroupv2 kernel min 4.15 & recommend version 5.8 for cgroup v2 kernel version can be 4.4 & 4.19+; recommend version 5.8 for cgroup v2 Jul 25, 2024
@pacoxu pacoxu force-pushed the cgroupv2-kernel-min-4.15 branch 2 times, most recently from c80cf2a to a9871d7 Compare July 25, 2024 03:51
validators/types.go Outdated Show resolved Hide resolved
validators/types_unix.go Outdated Show resolved Hide resolved
validators/types_windows.go Outdated Show resolved Hide resolved
validators/types_unix.go Outdated Show resolved Hide resolved
validators/kernel_validator_test.go Show resolved Hide resolved
Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

@pacoxu
Copy link
Member Author

pacoxu commented Jul 25, 2024

Updated.

Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

should we create a release after this PR merges?

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 31, 2024
@neolit123
Copy link
Member

/hold
drop the hold if needed.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 31, 2024
@pacoxu
Copy link
Member Author

pacoxu commented Jul 31, 2024

should we create a release after this PR merges?

Yes.

/hold
drop the hold if needed.

We may wait for another week or two in case SIG-Node owners have some inputs.

@neolit123
Copy link
Member

should we create a release after this PR merges?

Yes.

/hold
drop the hold if needed.

We may wait for another week or two in case SIG-Node owners have some inputs.

you should probably give them a ping on slack, or they will miss this.

Versions: []string{`^3\.[1-9][0-9].*$`, `^([4-9]|[1-9][0-9]+)\.([0-9]+)\.([0-9]+).*$`}, // Requires 3.10+, or newer
// 4.4 & 4.19 are selected as kernel Super Long Term Support (SLTS), and the Civil Infrastructure Platform will provide support until at least 2026.
Versions: []string{`^4\.4.*$`, `^4\.19.*$`, `^4\.[2-9][0-9].*$`, `^([5-9]|[1-9][0-9]+)\.([0-9]+)\.([0-9]+).*$`},
VersionsNote: "Recommended LTS versions from the 4.x series are 4.4 and 4.19. Any 4.x version newer than 4.19 is also supported. For cgroups v2 support, the minimal version is 4.15 and the recommended version is 5.8+",
Copy link
Member

Choose a reason for hiding this comment

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

for this note, do we have a check on cgroupv2 that the minimal version is satisfied?

cc: @harche

Copy link
Member Author

@pacoxu pacoxu Aug 2, 2024

Choose a reason for hiding this comment

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

The current statement is from

  1. https://github.com/opencontainers/runc/blob/ad5b481dace5cda8ca7c659b7717a15517333198/docs/cgroup-v2.md?plain=1#L23-L24 Recommended version: 5.2 or later & Minimum version: 4.15
  2. https://kubernetes.io/docs/concepts/architecture/cgroups/#requirements: Linux Kernel version is 5.8 or later

If the runc one is not accurate, we may change to the minimal version is 5.8

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine with the message. Just was wondering if we need to add a validaiton in kubelet on start when cgroupv2 are used.

Copy link
Member Author

Choose a reason for hiding this comment

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

there are many kernel version validations in kube. Mainly related to some FG or sysctl.

We may add a warning first for kubelet using cgoup v2.

Copy link
Member Author

@pacoxu pacoxu Aug 8, 2024

Choose a reason for hiding this comment

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

[1.32 placeholder for the cgroup v2 kernel version check in kubelet]kubernetes/kubernetes#126595

validators/kernel_validator_test.go Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 4, 2024
@pacoxu
Copy link
Member Author

pacoxu commented Aug 6, 2024

According to some discussions in endoflife-date/endoflife.date#5608 (comment), the CIP seems to be not in https://www.kernel.org/category/releases.html and maintained in a different place(gitlab) than torvalds/linux.

I prefer to remove the 4.4.* here.

@neolit123
Copy link
Member

According to some discussions in endoflife-date/endoflife.date#5608 (comment), the CIP seems to be not in https://www.kernel.org/category/releases.html and maintained in a different place(gitlab) than torvalds/linux.

I prefer to remove the 4.4.* here.

+1 to keep only official lts

@pacoxu
Copy link
Member Author

pacoxu commented Aug 6, 2024

@pacoxu pacoxu changed the title kernel version can be 4.4 & 4.19+; recommend version 5.8 for cgroup v2 kernel version should be 4.19+; recommend version 5.8 for cgroup v2 Aug 6, 2024
Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

please squash the commits to 1 as well.

validators/types_unix.go Outdated Show resolved Hide resolved
validators/types_unix.go Outdated Show resolved Hide resolved
Signed-off-by: Paco Xu <paco.xu@daocloud.io>
Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 6, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: neolit123, pacoxu, SataQiu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@pacoxu
Copy link
Member Author

pacoxu commented Aug 12, 2024

/unhold
@neolit123 Could you trigger a release after v1.31.0 is released this week?

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 12, 2024
@k8s-ci-robot k8s-ci-robot merged commit 1e0d9c3 into kubernetes:master Aug 12, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/node Categorizes an issue or PR as relevant to SIG Node. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants