Skip to content

Commit af8df3a

Browse files
committed
add code reference for kernel version check
1 parent e9ad39d commit af8df3a

File tree

1 file changed

+36
-14
lines changed

1 file changed

+36
-14
lines changed

content/en/docs/reference/node/kernel-version-requirements.md

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,25 @@ weight: 10
77
{{% thirdparty-content %}}
88

99
Many features rely on specific kernel functionalities and have minimum kernel version requirements.
10+
However, relying solely on kernel version numbers may not be sufficient
11+
for certain operating system distributions,
12+
as maintainers for distributions such as RHEL, Ubuntu and SUSE often backport selected features
13+
to older kernel releases (retaining the older kernel version).
1014

11-
## Pod sysctls {#requirements-pod-sysctl}
15+
## Pod sysctls
1216

1317
On Linux, the `sysctl()` system call configures kernel parameters at run time. There is a command
1418
line tool named `sysctl` that you can use to configure these parameters, and many are exposed via
1519
the `proc` filesystem.
1620

1721
Some sysctls are only available if you have a modern enough kernel.
1822

19-
The following sysctls are supported in the [safe set](/docs/tasks/administer-cluster/sysctl-cluster/#safe-and-unsafe-sysctls)
20-
which has a minimal kernel version requirement:
23+
The following sysctls have a minimal kernel version requirement,
24+
and are supported in the [safe set](/docs/tasks/administer-cluster/sysctl-cluster/#safe-and-unsafe-sysctls):
2125

26+
<!--
27+
Code: https://github.com/kubernetes/kubernetes/blob/00236ae0d73d2455a2470469ed1005674f8ed61f/pkg/util/kernel/constants.go#L19-L45
28+
-->
2229
- `net.ipv4.ip_local_reserved_ports` (since Kubernetes 1.27, needs kernel 3.16+);
2330
- `net.ipv4.tcp_keepalive_time` (since Kubernetes 1.29, needs kernel 4.5+);
2431
- `net.ipv4.tcp_fin_timeout` (since Kubernetes 1.29, needs kernel 4.6+);
@@ -29,34 +36,49 @@ which has a minimal kernel version requirement:
2936

3037
### kube proxy `nftables` proxy mode
3138

32-
The [`nftables` mode](/docs/reference/networking/virtual-ips/#proxy-mode-nftables) of kube-proxy now requires version 1.0.1 or later
33-
of the nft command-line, and kernel 5.13 or later. (For testing/development
34-
purposes, you can use older kernels, as far back as 5.4, if you set the
35-
`nftables.skipKernelVersionCheck` option in the kube-proxy config, but this is not
36-
recommended in production since it may cause problems with other nftables
39+
<!--
40+
Code: https://github.com/kubernetes/kubernetes/blob/00236ae0d73d2455a2470469ed1005674f8ed61f/pkg/util/kernel/constants.go#L53-L56
41+
-->
42+
For Kubernetes {{< skew currentVersion >}}, the
43+
[`nftables` mode](/docs/reference/networking/virtual-ips/#proxy-mode-nftables) of kube-proxy requires
44+
version 1.0.1 or later
45+
of the nft command-line tool, as well as kernel 5.13 or later.
46+
47+
For testing/development purposes, you can use older kernels, as far back as 5.4 if you set the
48+
`nftables.skipKernelVersionCheck` option in the kube-proxy config.
49+
But this is not recommended in production since it may cause problems with other nftables
3750
users on the system.
3851

3952
## Version 2 control groups
4053

41-
cgroup v1 support is in maintained mode stating v1.31, and cgroup v2 is a recommended. So very soon _Kubernetes_ Linux nodes will at least recommend this kernel version.
54+
Kubernetes cgroup v1 support is in maintained mode starting from Kubernetes v1.31; using cgroup v2
55+
is recommended.
4256
In [Linux 5.8](https://github.com/torvalds/linux/commit/4a7e89c5ec0238017a757131eb9ab8dc111f961c), the system-level `cpu.stat` file was added to the root cgroup for convenience.
4357

44-
In [runc document](https://github.com/containerd/cgroups/blob/0c03de4a3d82a5f02f455ccc8174cb0dc9c2a532/cgroup2/manager.go#L411-L430), Kernel older than 5.2 is not recommended due to lack of freezer.
58+
In runc document, Kernel older than 5.2 is not recommended due to lack of freezer.
4559

4660
## Other kernel requirements {#requirements-other}
4761

4862
Some features may depend on new kernel functionalities and have specific kernel requirements:
4963

50-
1. [Recursive read only mount](/docs/concepts/storage/volumes/#recursive-read-only-mounts): This is implemented by applying the `MOUNT_ATTR_RDONLY` attribute with the `AT_RECURSIVE` flag using `mount_setattr`(2) added in Linux kernel v5.12.
51-
2. Pod user namespace support requires minimal kernel version 6.5+, according to [KEP-127](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/127-user-namespaces/README.md).
52-
3. For [node system swap](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/2400-node-swap/README.md), tmpfs noswap is not supported until kernel 6.3.
64+
<!--
65+
Code(recursive read only mount): https://github.com/kubernetes/kubernetes/blob/00236ae0d73d2455a2470469ed1005674f8ed61f/staging/src/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto#L1605-L1609
66+
Code(user namespace and swap): https://github.com/kubernetes/kubernetes/blob/00236ae0d73d2455a2470469ed1005674f8ed61f/pkg/util/kernel/constants.go#L47-L51
67+
-->
68+
1. [Recursive read only mount](/docs/concepts/storage/volumes/#recursive-read-only-mounts):
69+
This is implemented by applying the `MOUNT_ATTR_RDONLY` attribute with the `AT_RECURSIVE` flag
70+
using `mount_setattr`(2) added in Linux kernel v5.12.
71+
2. Pod user namespace support requires minimal kernel version 6.5+, according to
72+
[KEP-127](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/127-user-namespaces/README.md).
73+
3. For [node system swap](/docs/concepts/architecture/nodes/#swap-memory), tmpfs set to `noswap`
74+
is not supported until kernel 6.3.
5375

5476
## Linux kernel long term maintenance
5577

5678
Active kernel releases can be found in [kernel.org](https://www.kernel.org/category/releases.html).
5779

5880
There are usually several _long term maintenance_ kernel releases provided for the purposes of backporting
59-
bugfixes for older kernel trees. Only important bugfixes are applied to such kernels and they don't
81+
bug fixes for older kernel trees. Only important bug fixes are applied to such kernels and they don't
6082
usually see very frequent releases, especially for older trees.
6183
See the Linux kernel website for the [list of releases](https://www.kernel.org/category/releases.html)
6284
in the _Longterm_ category.

0 commit comments

Comments
 (0)