-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Warn user when host is using cgroup v1 in KIC #22357
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
base: master
Are you sure you want to change the base?
Warn user when host is using cgroup v1 in KIC #22357
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ThankaBharathi The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @ThankaBharathi. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Can one of the admins verify this patch? |
|
@ThankaBharathi you need to rebase, there is some Falco commit attached here |
afef2fd to
e06c8b3
Compare
|
Thanks for pointing that out! I’ve rebased the branch and removed the unrelated Falco commit. |
| } | ||
|
|
||
| // IsCgroupV2 returns true if the host is using cgroup v2 | ||
| func IsCgroupV2() bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ThankaBharathi I am curious was this generated by AI?
we already have a func I think that checks the cgroups, I dont think, I think this PR might need to be on hold for more surgical or tactical
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification.
I double checked this by grepping the repo:
While there is a cgroup v2 detection in deploy/kicbase/entrypoint (inside the node/container) and in various runtime/bootstrap path.
I couldn't find an existing go helper at the KIC host layer that explicitly distinguishes cgroup v1 vs v2 during container node creation. The existing helper in pkg/drivers/kic/oci focus on controller availability (memory/swap), Which is why added the small IsCgroupV2 function check here for host side warn.
If you would prefer this logic to live else to be refactored to align with an existing pattern , I'm happy to adjust.
|
Thanks for this question No this is was not add by an ai. The intent was to add a very small, explicit check to distinguish cgroup v1 vs v2, since the existing helper in this file focus on controller availability (memory/swap) rather than identification whether the host is running a unified cgroup v2 hierarchy. That said, I completely agree that it would be better to reuse or extend an existing helper if there is one that aldready capture this distinction. I'm happy to adjust the implementation to take it more surgical/tactical. Please let me know which exsiting function you'd prefer to build on, or the direction you'd like this to take. |
What this PR does
Why
Minikube may assume cgroup v2 support even when the host is using cgroup v1, which can lead to confusing runtime or test failures. This change adds an early, clear warning so users understand potential limitations before encountering issues.
Example
On a Linux host using cgroup v1 (for example, older distributions or systems with legacy cgroup configuration), starting Minikube with the KIC driver will now print the following warning during node creation:
WARNING: Host system is using cgroup v1.
Minikube will not enable cgroup v2.
Some features may not work as expected.
This improves user visibility and avoids silent misconfiguration.
Scope
Fixes #22321