Skip to content

Commit

Permalink
Added CPU and memory settings for k8s Vagrantfile
Browse files Browse the repository at this point in the history
Signed-off-by: Vikram Hosakote <vhosakot@cisco.com>
  • Loading branch information
vhosakot committed Oct 17, 2017
1 parent 9f6e8e7 commit 61c0a42
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ $ cd netplugin; make demo
$ vagrant ssh netplugin-node1
```

Optionally, variables can be passed to Makefile if needed. For example, to
use 1GB memory for the vagrant VMs, run:

```
CONTIV_MEMORY=1024 make demo
```

#### Step 2: Create a network

```
Expand Down
5 changes: 4 additions & 1 deletion vagrant/k8s/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ master_ip = "192.168.2.10"

http_proxy = ENV['HTTP_PROXY'] || ENV['http_proxy'] || ''
https_proxy = ENV['HTTPS_PROXY'] || ENV['https_proxy'] || ''
num_vm_cpus = (ENV['CONTIV_CPUS'] || 4).to_i
vm_memory = (ENV['CONTIV_MEMORY'] || 2048).to_i

# python -c 'import random; print "%0x.%0x" % (random.SystemRandom().getrandbits(3*8), random.SystemRandom().getrandbits(8*8))
token = "d900e1.8a392798f13b33a4"
Expand Down Expand Up @@ -211,7 +213,8 @@ Vagrant.configure(2) do |config|
c.vm.network :private_network, ip: member_info["contiv_network_ip"], virtualbox__intnet: network_name, auto_config: false
c.vm.provider "virtualbox" do |v|
customize(v)
v.memory = 2048
v.memory = vm_memory
v.cpus = num_vm_cpus
v.customize ['modifyvm', :id, '--nicpromisc2', 'allow-all']
v.customize ['modifyvm', :id, '--nicpromisc3', 'allow-all']
end # v
Expand Down

0 comments on commit 61c0a42

Please sign in to comment.