Skip to content

Commit

Permalink
Vagrant VM memory environment variable.
Browse files Browse the repository at this point in the history
Has Vagrant try to read `KUBERNETES_MEMORY` environment varilable when setting
$vm_mem.

fixes kubernetes#3792
  • Loading branch information
ryfow committed Mar 4, 2015
1 parent 0059c39 commit 749ae3d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ else # sorry Windows folks, I can't help you
$vm_cpus = 2
end

# Give VM 1024MB of RAM
# Give VM 1024MB of RAM by default
# In Fedora VM, tmpfs device is mapped to /tmp. tmpfs is given 50% of RAM allocation.
# When doing Salt provisioning, we copy approximately 200MB of content in /tmp before anything else happens.
# This causes problems if anything else was in /tmp or the other directories that are bound to tmpfs device (i.e /run, etc.)
$vm_mem = 1024
$vm_mem = (ENV['KUBERNETES_MEMORY'] || 1024).to_i

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
def customize_vm(config)
Expand Down
9 changes: 9 additions & 0 deletions docs/getting-started-guides/vagrant.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,5 +307,14 @@ You can control the number of minions that are instantiated via the environment
export NUM_MINIONS=1
```

#### I want my VMs to have more memory !

You can control the memory allotted to virtual machines with the `KUBERNETES_MEMORY` environment variable.
Just set it to the number of megabytes you would like the machines to have. For example:

```
export KUBERNETES_MEMORY=2048
```

#### I ran vagrant suspend and nothing works!
```vagrant suspend``` seems to mess up the network. It's not supported at this time.

0 comments on commit 749ae3d

Please sign in to comment.