Skip to content

Conversation

@ThankaBharathi
Copy link

What this PR does

  • Detects when the host system is using cgroup v1
  • Warns users during KIC (Kubernetes in Docker) node creation

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

  • Linux only
  • KIC driver only

Fixes #22321

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ThankaBharathi
Once this PR has been reviewed and has the lgtm label, please assign comradeprogrammer for approval. For more information see the Code Review Process.

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

Details 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

@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 29, 2025
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@afbjorklund
Copy link
Collaborator

@ThankaBharathi you need to rebase, there is some Falco commit attached here

@ThankaBharathi ThankaBharathi force-pushed the detect-cgroup-v1-warning branch from afef2fd to e06c8b3 Compare December 29, 2025 18:22
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 29, 2025
@ThankaBharathi
Copy link
Author

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 {
Copy link
Member

@medyagh medyagh Dec 29, 2025

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

Copy link
Author

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.

@ThankaBharathi
Copy link
Author

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.

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

detect and warn user if the "Host" is using cgroup v1

5 participants