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

Automatically scale the default memory allocation #6900

Merged
merged 4 commits into from
Mar 5, 2020

Conversation

tstromberg
Copy link
Contributor

@tstromberg tstromberg commented Mar 5, 2020

  • If it's KIC, allow minikube to grow up until the containers maximum footprint, minus 128MB. This safety margin is to avoid unexpected results if someone else has a small docker image running.

  • If it's a VM, allocate 25% of the available memory, up to 6GB. Never allocate less than 2.2GB by default. This balances the safety of a well-configured VM up-front, and the ability to run multiple local clusters.

  • Specifically allocate memory ranges for most integration tests, so that they can coexist in parallel on a single machine.

Fixes #5021

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Mar 5, 2020
@tstromberg tstromberg requested a review from medyagh March 5, 2020 20:05
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 5, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 5, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tstromberg

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 5, 2020
@tstromberg
Copy link
Contributor Author

/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 Mar 5, 2020
@codecov-io
Copy link

Codecov Report

Merging #6900 into master will increase coverage by 0.03%.
The diff coverage is 34.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6900      +/-   ##
==========================================
+ Coverage   37.11%   37.15%   +0.03%     
==========================================
  Files         144      144              
  Lines        8955     8979      +24     
==========================================
+ Hits         3324     3336      +12     
- Misses       5212     5220       +8     
- Partials      419      423       +4
Impacted Files Coverage Δ
cmd/minikube/cmd/start.go 32.96% <34.88%> (+0.79%) ⬆️

@minikube-pr-bot
Copy link

All Times minikube: [ 93.192010 92.873971 90.675578]
All Times Minikube (PR 6900): [ 94.886672 95.094361 92.362530]

Average minikube: 92.247186
Average Minikube (PR 6900): 94.114521

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 6900) |
+----------------------+-----------+--------------------+
| minikube v           |  0.212472 |           0.209749 |
| Creating kvm2        | 20.543964 |          20.157274 |
| Preparing Kubernetes | 49.096021 |          50.736928 |
| Pulling images       |           |                    |
| Launching Kubernetes | 20.818497 |          21.619912 |
| Waiting for cluster  |  0.058036 |           0.062175 |
+----------------------+-----------+--------------------+

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 5, 2020
@minikube-pr-bot
Copy link

All Times minikube: [ 92.365465 92.052297 93.063564]
All Times Minikube (PR 6900): [ 92.463622 94.669592 92.191196]

Average minikube: 92.493776
Average Minikube (PR 6900): 93.108137

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 6900) |
+----------------------+-----------+--------------------+
| minikube v           |  0.199841 |           0.207232 |
| Creating kvm2        | 20.422828 |          20.085935 |
| Preparing Kubernetes | 50.094833 |          49.921209 |
| Pulling images       |           |                    |
| Launching Kubernetes | 20.444812 |          21.618871 |
| Waiting for cluster  |  0.059486 |           0.062300 |
+----------------------+-----------+--------------------+

@medyagh
Copy link
Member

medyagh commented Mar 5, 2020

tried it locally with my mac looks good

Password: 
💿  Downloading VM boot image ...
    > minikube-v1.7.3.iso.sha256: 65 B / 65 B [--------------] 100.00% ? p/s 0s
    > minikube-v1.7.3.iso: 167.39 MiB / 167.39 MiB [] 100.00% 16.85 MiB p/s 10s
🔥  Creating hyperkit VM (CPUs=2, Memory=4096MB, Disk=20000MB) 

@medyagh medyagh merged commit 96fea8d into kubernetes:master Mar 5, 2020
@afbjorklund
Copy link
Collaborator

Did you feedback this to kubeadm, that it no longer works with the recommended 2048M ?

https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/

  • 2 GB or more of RAM per machine (any less will leave little room for your apps)
  • 2 CPUs or more

Or is the problem that it needs 2Gi free - just for Kubernetes, rather than 2Gi total ?

The wording of "per machine" is a little ambiguous. Elsewhere it says "per node"

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.

Choose smarter defaults for --memory
6 participants