Skip to content
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

Add ability to pass 'max' value to memory and cpus flags #11692

Merged
merged 10 commits into from
Jun 28, 2021

Conversation

spowelljr
Copy link
Member

@spowelljr spowelljr commented Jun 17, 2021

Part of #11650

Problem:
There's currently no way to automatically maximize memory and cpu allocation.

Solution:
Added the ability to pass mamx to the memory and cpus flags on minikube start. Passing that value will allocate maximum resources to minikube.

Example:

minikube start --memory=max cpus=max
...
🔥  Creating docker container (CPUs=6, Memory=5945MB) ...

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 17, 2021
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 17, 2021
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 17, 2021
cmd/minikube/cmd/start_flags.go Outdated Show resolved Hide resolved
pkg/minikube/constants/constants.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 23, 2021
Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is a VM driver user sets --CPUs=Max what happens?

@medyagh
Copy link
Member

medyagh commented Jun 23, 2021

as part of this PR I think I was expecting to see the oci package be touched in a way that this line should NOt be appended (and leave it without --memory

		if memcg {
			runArgs = append(runArgs, fmt.Sprintf("--memory=%s", p.Memory))
		}


https://github.com/medyagh/minikube/blob/00cc926649f84edf2dc5b4a202ceaafb7a79e727/pkg/drivers/kic/oci/oci.go#L212

@medyagh
Copy link
Member

medyagh commented Jun 23, 2021

could we see metrics of time2k8s after this PR ? does it make any diff?

@spowelljr
Copy link
Member Author

could we see metrics of time2k8s after this PR ? does it make any diff?

The minikube start command completes 2.7 seconds faster with --memory=max --cpus=max flags used.

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 24, 2021
@spowelljr spowelljr changed the title Add ability to pass 'nolimit' value to memory and cpus flags Add ability to pass 'max' value to memory and cpus flags Jun 24, 2021
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 25, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 25, 2021
@medyagh
Copy link
Member

medyagh commented Jun 25, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jun 25, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh, spowelljr

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

The pull request process is described here

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

@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 11692) |
+----------------+----------+---------------------+
| minikube start | 48.3s    | 48.4s               |
| enable ingress | 37.9s    | 38.1s               |
+----------------+----------+---------------------+

Times for minikube ingress: 38.8s 35.7s 35.3s 42.8s 36.8s
Times for minikube (PR 11692) ingress: 34.8s 41.8s 41.8s 38.3s 33.8s

Times for minikube (PR 11692) start: 51.3s 50.0s 47.3s 47.4s 46.0s
Times for minikube start: 49.7s 46.7s 48.1s 48.7s 48.4s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 11692) |
+----------------+----------+---------------------+
| minikube start | 22.3s    | 22.1s               |
| enable ingress | 34.9s    | 35.6s               |
+----------------+----------+---------------------+

Times for minikube (PR 11692) start: 22.6s 21.9s 21.8s 22.7s 21.5s
Times for minikube start: 23.6s 21.4s 22.1s 22.6s 21.8s

Times for minikube ingress: 33.0s 35.5s 33.5s 38.0s 34.5s
Times for minikube (PR 11692) ingress: 34.5s 37.5s 35.0s 32.5s 38.5s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 11692) |
+----------------+----------+---------------------+
| minikube start | 42.1s    | 44.4s               |
| enable ingress |          |                     |
+----------------+----------+---------------------+

Times for minikube (PR 11692) start: 43.3s 43.7s 43.6s 47.5s 43.8s
Times for minikube start: 32.4s 43.6s 43.5s 47.4s 43.8s

@spowelljr spowelljr merged commit e8b3db9 into kubernetes:master Jun 28, 2021
@spowelljr spowelljr deleted the addNoLimit branch June 28, 2021 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants