kubernetes / system-validators

A set of system-oriented validators for kubeadm preflight checks.
Apache License 2.0
35 stars 27 forks source link

kubeadm shows SystemVerification warning about "missing optional cgroups: blkio" #31

Closed orimanabu closed 2 years ago

orimanabu commented 2 years ago

Sysmptom I ran kubeadm on CentOS Stream 9 and got a warning.

    [WARNING SystemVerification]: missing optional cgroups: blkio

Reproducibility Always

Environment

Investigation CentOS Stream 9 runs with cgroups v2 only. "blkio" controller seems to be available only for cgroups v1 according to man cgroups(7).

   Cgroups v2 controllers
<snip>
       io (since Linux 4.5)
              This is the successor of the version 1 blkio controller.

We should update CgroupsV2Optional for cgroups v2 ?

neolit123 commented 2 years ago

IIRC This was intended like so. It applies to v1 and v2. Cc @pacoxu

orimanabu commented 2 years ago

FYI, this is my /sys/fs/cgroup/cgroup.controllers.

[ori@c9s ~]$ cat /sys/fs/cgroup/cgroup.controllers 
cpuset cpu io memory hugetlb pids rdma misc
[ori@c9s ~]$ cat /etc/os-release 
NAME="CentOS Stream"
VERSION="9"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="9"
PLATFORM_ID="platform:el9"
PRETTY_NAME="CentOS Stream 9"
ANSI_COLOR="0;31"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:centos:centos:9"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 9"
REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"
[ori@c9s ~]$ uname -r
5.14.0-96.el9.x86_64
KentaTada commented 2 years ago

Thanks! @orimanabu I took a quick look at this issue. When system-validators gets the list of controllers are enabled by the kernel, it reads the cgroup mount point + "cgroup.controllers"(Ex. /sys/fs/cgroup/cgroup.controllers). See https://github.com/kubernetes/system-validators/blob/v1.7.0/validators/cgroup_validator_linux.go#L148 cgroup.controllers outputs io instead of blkio. But the current definition of CgroupsV2Optional include not io but blkio. https://github.com/kubernetes/system-validators/pull/29 We should modify the definition of CgroupsV2Optional as he said.

orimanabu commented 2 years ago

Thank you for merging https://github.com/kubernetes/system-validators/pull/32 . Please close this issue.

neolit123 commented 2 years ago

this change will be available in kubeadm 1.25 if we follow the idea mentioned in https://github.com/kubernetes/system-validators/pull/32#pullrequestreview-989206032

devopstales commented 2 years ago

Still an issue in Kubernetes 1.25

pacoxu commented 2 years ago

Still an issue in Kubernetes 1.25

https://github.com/kubernetes/system-validators/pull/32/ was merged after v1.7.0 which is used by kubeadm now. The issue was fixed in system validator, but not in kubeadm yet.

@neolit123 Would you help to release a new version for system-validators so that we can sync it to kubeadm?

neolit123 commented 2 years ago

Would you help to release a new version for system-validators so that we can sync it to kubeadm?

yes, i can release a new version today

neolit123 commented 2 years ago

@pacoxu https://github.com/kubernetes/system-validators/releases/tag/v1.8.0 is released

would you like to vendor it in k/k? https://github.com/kubernetes/system-validators#creating-releases

@devopstales this will make it available in 1.26, until then you have to skip the preflight.

neolit123 commented 2 years ago

...or should remove the v1.8.0 version and release a v1.7.1 that can be backported / vendored to v1.25 and to be available in v1.26?

pacoxu commented 2 years ago

v1.7.1

Sounds better. Backport cannot be a new major version for dependencies IMO.