Skip to content

Commit 61c0a42

Browse files
committed
Added CPU and memory settings for k8s Vagrantfile
Signed-off-by: Vikram Hosakote <[email protected]>
1 parent 9f6e8e7 commit 61c0a42

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ $ cd netplugin; make demo
3838
$ vagrant ssh netplugin-node1
3939
```
4040

41+
Optionally, variables can be passed to Makefile if needed. For example, to
42+
use 1GB memory for the vagrant VMs, run:
43+
44+
```
45+
CONTIV_MEMORY=1024 make demo
46+
```
47+
4148
#### Step 2: Create a network
4249

4350
```

vagrant/k8s/Vagrantfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ master_ip = "192.168.2.10"
1212

1313
http_proxy = ENV['HTTP_PROXY'] || ENV['http_proxy'] || ''
1414
https_proxy = ENV['HTTPS_PROXY'] || ENV['https_proxy'] || ''
15+
num_vm_cpus = (ENV['CONTIV_CPUS'] || 4).to_i
16+
vm_memory = (ENV['CONTIV_MEMORY'] || 2048).to_i
1517

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

0 commit comments

Comments
 (0)