Skip to content

start: allow 1-CPU nodes when --no-kubernetes is used#22957

Open
Pittu-Sharma wants to merge 1 commit into
kubernetes:masterfrom
Pittu-Sharma:fix/allow-1cpu-no-kubernetes
Open

start: allow 1-CPU nodes when --no-kubernetes is used#22957
Pittu-Sharma wants to merge 1 commit into
kubernetes:masterfrom
Pittu-Sharma:fix/allow-1cpu-no-kubernetes

Conversation

@Pittu-Sharma
Copy link
Copy Markdown

Summary

This PR resolves a regression where minikube enforced a strict 2-CPU minimum requirement even when the --no-kubernetes flag was provided.

The 2-CPU minimum is a requirement for a stable Kubernetes control plane; however, when a user opts to start minikube without bootstrapping Kubernetes (e.g., to run plain Docker/Containerd workloads), this restriction is unnecessary and prevents minikube from running on resource-constrained environments like single-CPU CI runners or small cloud instances.

Changes

  • Modified validateCPUCount in cmd/minikube/cmd/start.go to bypass both the hardware availability check and the requested-CPU minimum check when no-kubernetes is active.
  • Refactored validateCPUCount to use the cobra.Command object, allowing the system to distinguish between the default CPU count (2) and an explicit user request (e.g., --cpus 1).
  • Ensures that minikube will automatically proceed with 1 CPU on 1-CPU systems in --no-kubernetes mode if no specific CPU count was requested.

Verification

  • Unit Tests: Added and ran a targeted test suite verifying that the validation is correctly skipped only when --no-kubernetes is set.
  • Build: Verified that the project builds successfully (go build ./cmd/minikube).
  • Dry-run: Verified flag parsing and initialization logic with minikube start --dry-run.

Fixes #22152

When --no-kubernetes is set, minikube starts a VM or container without
bootstrapping Kubernetes. The 2-CPU minimum exists solely because the
Kubernetes control plane needs at least 2 CPUs to be stable. Enforcing
it in --no-kubernetes mode prevents single-CPU containers from running
plain workloads, contrary to what the flag promises.

Skip both the host availability check (< 2 CPUs triggers an exit) and
the requested-CPU minimum check when --no-kubernetes is active.

Fixes kubernetes#22152
@k8s-ci-robot k8s-ci-robot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label May 9, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Invalid commit message issues detected

Invalid commit messages

Keywords which can automatically close issues and hashtag(#) mentions are not allowed.

  • 0cc4070 start: skip 2-CPU Kubernetes requirement with --no-kubernetes

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. I understand the commands that are listed here.

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Pittu-Sharma
Once this PR has been reviewed and has the lgtm label, please assign medyagh 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 k8s-ci-robot requested review from medyagh and nirs May 9, 2026 13:08
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @Pittu-Sharma!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 9, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @Pittu-Sharma. Thanks for your PR.

I'm waiting for a kubernetes 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 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 May 9, 2026
@minikube-bot
Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

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. do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. 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.

minikube should allow 1 cpu --no-kubernetes

3 participants