start: allow 1-CPU nodes when --no-kubernetes is used#22957
start: allow 1-CPU nodes when --no-kubernetes is used#22957Pittu-Sharma wants to merge 1 commit into
Conversation
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
|
Invalid commit message issues detected Invalid commit messagesKeywords which can automatically close issues and hashtag(#) mentions are not allowed.
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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Pittu-Sharma 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 |
|
Welcome @Pittu-Sharma! |
|
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 Regular contributors should join the org to skip this step. 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? |
Summary
This PR resolves a regression where
minikubeenforced a strict 2-CPU minimum requirement even when the--no-kubernetesflag 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
validateCPUCountincmd/minikube/cmd/start.goto bypass both the hardware availability check and the requested-CPU minimum check whenno-kubernetesis active.validateCPUCountto use thecobra.Commandobject, allowing the system to distinguish between the default CPU count (2) and an explicit user request (e.g.,--cpus 1).--no-kubernetesmode if no specific CPU count was requested.Verification
--no-kubernetesis set.go build ./cmd/minikube).minikube start --dry-run.Fixes #22152